Whitelisted null origin value
The specification for the Origin header supports the value null. Browsers might send the value null in the Origin header in various unusual situations:
Cross-origin redirects.
Requests from serialized data.
Request using the
file:
protocol.Sandboxed cross-origin requests.
Some applications might whitelist the null origin to support local development of the application. For example, suppose an application receives the following cross-origin request:
And the server responds with:
In this situation, an attacker can use various tricks to generate a cross-origin request containing the value null in the Origin header. This will satisfy the whitelist, leading to cross-domain access.
For example, this can be done using a sandboxed iframe cross-origin request of the form:
Iframe with
src
attribute with HTML Content is cross domain,
iframe with
srcDoc
attribute with HTML Content is not cross domain
Last updated