You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
XSRF header is still sent to other origins on 20.3.x through backslash and whitespace URLs #71294
The browser does not resolve req.url the way this regex reads it. For http/https, the WHATWG URL parser treats \ as /, strips leading spaces and C0 control characters, and removes tab, LF and CR anywhere. So these URLs do not match the regex and get the token, but the browser sends them to evil.example:
The precondition is the same as in GHSA-58c5-g7wp-6w37: the attacker can make the app send a mutating request to a URL they control. Their server only has to allow the origin and the custom header through CORS.
//evil.example/x and https://evil.example/x are correctly skipped on 20.3.33. '/\\evil.example/x' starts with a single / and has no scheme, so it also passes a url.startsWith('/') check.
main, 21.0.3+ and 22.x are not affected, because #65683 replaced the regex with a new URL(req.url, locationOrigin).origin comparison. It never reached 20.3.x, which is in LTS, so 20.3.33 is still affected.
I tested Angular 20.3.33 and 22.2.2 in Chrome 154, with both provideHttpClient() and withFetch(), 3 runs each:
Page
Token sent to evil.example on 20.3.33
22.2.2
http://
all forms above, and their http: spellings
0
https://
all forms above (http: spellings are blocked as mixed content)
0
https:// + CSP upgrade-insecure-requests
all forms above, and the 5 http: spellings (e.g. http:\\evil.example/x, http:evil.example/x)
0
Please provide a link to a minimal reproduction of the bug
Activity
fix(http): enable XSRF protection for same-origin absolute URLs
fix(http): enable XSRF protection for same-origin absolute URLs
SkyZeroZx commentedon Oct 15, 2026
@alan-agius4 Maybe this warrants a security advisory, since GHSA-58c5-g7wp-6w37 claims to fix it and we could consider this a bypass
alan-agius4 commentedon Oct 16, 2026
Yes, will do.