Skip to content
Snippets Groups Projects
Unverified Commit 2476d537 authored by Denis Kasak's avatar Denis Kasak Committed by GitHub
Browse files

Mitigate media repo XSSs on IE11. (#10468)


IE11 doesn't support Content-Security-Policy but it has support for
a non-standard X-Content-Security-Policy header, which only supports the
sandbox directive. This prevents script execution, so it at least offers
some protection against media repo-based attacks.

Signed-off-by: default avatarDenis Kasak <dkasak@termina.org.uk>
parent b3a757eb
No related branches found
No related tags found
No related merge requests found
Mitigate media repo XSS attacks on IE11 via the non-standard X-Content-Security-Policy header.
......@@ -49,6 +49,8 @@ class DownloadResource(DirectServeJsonResource):
b" media-src 'self';"
b" object-src 'self';",
)
# Limited non-standard form of CSP for IE11
request.setHeader(b"X-Content-Security-Policy", b"sandbox;")
request.setHeader(
b"Referrer-Policy",
b"no-referrer",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment