Skip to content

Add ability to bypass state validation, for Platform Storage use-case #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

junglebarry
Copy link
Collaborator

@junglebarry junglebarry commented Oct 6, 2022

When we implement LTI Platform Storage API, downstream single-page-apps must take responsibility for validating the state against the Platform Storage API, rather than using cookies. In this scenario, we want to be able to bypass the cookie-based state validation step entirely.

In this PR, we add an optional parameter - which defaults to false - to insecurelyBypassStateValidation.

@junglebarry junglebarry force-pushed the make_state_validation_optional branch from c5524e1 to 619666b Compare October 6, 2022 15:12
@junglebarry junglebarry requested a review from rsinger October 6, 2022 15:13
Copy link
Member

@rsinger rsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, codewise, this all seems fine to me.

I'll be honest that I do not really understand the risks introduced by this. I mean, I understand what it's doing and can think of theoretical problems, but I can't fully wrap my head around how the launch flow could be compromised in practice.

I think the bigger issue, honestly, is social engineering, and how we manage customer expectations around this, especially the VLE administrators, who have no reason to trust us whatsoever.

@junglebarry
Copy link
Collaborator Author

@rsinger the changes introduced here should have no consequence for the launch flow - it should not be compromised in practice or in theory, because the CSRF protection will still be implemented by another means (in the SPA, using Platform Storage API). This is just providing users this library with the ability to take responsibility for the CSRF validation themselves.

However, by even allowing this there is an inherent risk, in that someone might accidentally introduce mistakes in their implementation of the CSRF protection. However, it can't be the responsibility of this library (as a server-side only component) to enforce this. I think the remit of this library's involvement in CSRF protection stops with "making clear to the developer that they have taken responsibility for CSRF". If you feel this code achieves that, then this PR can be merged.

I think the LTI working group did have a good discussion of how the CSRF attack works, see around 11:45 in this video. I don't disagree that there are other attack vectors that are probably more practically problematic, but they're probably for a different discussion.

@rsinger
Copy link
Member

rsinger commented Oct 7, 2022

@junglebarry I feel pretty satisfied with this explanation. Like I said, I didn't feel there were really very many practical vulnerabilities, but I wanted to understand the risks a little better. And the default is for it to be on, anyway.

I agree that it's not the responsibility of the library to enforce that users don't misuse it. I do think it's reasonable to relay the risks of what disabling this would leave the developer on the hook for, although I don't think that needs to be programmatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants