Skip to content
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

Fix http server XSS #1714

Merged
merged 3 commits into from Aug 27, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Address @diracdeltas feedback on #1714

  • Loading branch information
feross committed Aug 27, 2019
commit 9029557ca3d22faef67315f8ed33df295ce6d59e
@@ -88,7 +88,7 @@ function Server (torrent, opts = {}) {
res.setHeader('X-Content-Type-Options', 'nosniff')

// Defense-in-depth: Set a strict Content Security Policy to mitigate XSS
res.setHeader('Content-Security-Policy', "base-uri 'none'; default-src 'none'; frame-ancestors 'none'; object-src 'none';")
res.setHeader('Content-Security-Policy', "base-uri 'none'; default-src 'none'; frame-ancestors 'none'; form-action 'none';")

if (pathname === '/favicon.ico') {
return serve404Page()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.