-
Notifications
You must be signed in to change notification settings - Fork 887
CSRF enforcement in v2.6.0 breaks RStudio IDE and other POST requests #11406
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
Comments
Thank you for reporting this. This is a bug and I will work on this. I think this can be solved by exempting all path based application routes. |
fix and test to ensure this does not happen again: #11430 |
@Emyrk thanks for working on this issue and a belated Happy New Year while am at it! Since this CSRF situations really bites us in the back in some form or another in our apps, I wanted to ask if there's a timeline regarding cutting the next release? Cheers |
Hey! I can cut a release tomorrow :) |
Update: we ran into several release blockers. Might have to wait until tomorrow or Monday. |
I see. Good luck! Thanks for the heads up... |
@bpmct Hey, stumbled across this resolved issue. Since that CSRF enforcement renders many of our apps unusable as well, I was wondering if those release blockers have been resolved? Appreciate it! :) |
Yep - v2.7.1 includes the fix |
Hello,
we have a template running code-server and RStudio as IDEs.
The v2.6.0 release seems to brake the RStudio IDE and all POST requests inside apps running in vscode.
We think we got it down to #11283 enforcing CSRF.
All requests to the Coder API are functional but inside the IDEs POST requests are not.
This is due to the X-CSRF-TOKEN header not being set on the other requests.
Is there some way to fix this on our side or should there maybe another exempt in coderd/httpmw/csrf.go for the URLs where apps are running, e.g.
/@USER/test.instance/apps/
?Or maybe a switch to remove the enforcement of CSRF for now?
I'm not really experienced with CSRF so I'm looking forward to your help!
Expected Behavior
RStudio opens as usual, which it did before upgrading to v2.6.0.
Actual Behavior
RStudio does not start and throws the following error:

This can be backtraced to this POST call failing due to the coder CSRF protection kicking in.
Note that the rs-csrf-token and csrf-token cookies are from RStudio and the csrf_token cookie is from Coder
Response:
400 | Something is wrong with your CSRF token. Please refresh the page. If this error persists, try clearing your cookies.
When I set the X-CSRF-TOKEN header manually and resend the request, it gets through but RStudio still doesn't start...
Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: