Exploiting CORS Misconfigurations
An unrestricted CORS endpoint that also honours HTTP override headers lets an attacker route the actual cross-origin request to a different part of the stack than the one that answered the preflight. This could allow access to endpoints not enabled for CORS, bypass CSRF protections, and deliver a cross-site tracing attack that reads cookies marked httpOnly.
If you can find an unrestricted CORS endpoint, that also responds to the HTTP override headers, then potentially you can use it to access endpoints that aren’t enabled for CORS, bypass CSRF protections, and also deliver an XST (which will give you access to cookies protected by the httpOnly attribute).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the permissive CORS endpoint and the backend disagree about which headers matter, so override headers in the real request redirect it to a non-CORS endpoint after the preflight has already been approved.
Impact
An attacker could reach endpoints not enabled for CORS, bypass CSRF protections and read httpOnly cookies via XST, though the author notes this should no longer work in the latest browser code.
What the attacker needed
Victim visits attacker page; unrestricted CORS endpoint; endpoint honours override headers; older browser version
The fix
Endpoints answering preflight requests should accept only the minimum headers needed, and override headers should be stripped or rejected early in the stack.
How it was found
- Find unrestricted CORS endpoints that allow authentication and the override headers by sending many preflight requests.
- Check whether those endpoints also respond to one of the override headers.
- Use host, URI or method override headers to redirect the actual request to another endpoint or server.
- Use the resulting request to reach non-CORS endpoints, bypass CSRF tokens, or perform XST.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
CORS is a browser rule that decides whether a page on one site may read a response from another site. A preflight is a small check request the browser sends first, and the real request follows only if the check passes. Here the check was answered by a permissive server, but the real request carried extra headers that made the backend send it somewhere else, so the browser's check no longer matched what actually happened.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.