-
Notifications
You must be signed in to change notification settings - Fork 919
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
Add base-uri
Directive to Content Security Policy
#15555
Comments
base-uri
base-uri
Directive to Content Security Policy
There don't seem to be any The public facing site should be fine, question is whether Wagtail doesn't need that for anything, but the only base use I can spot is in targets for opening new windows, so a RO test-drive should surface any violations, but hopefully there would be none. 🤞 |
Just an FYI but So if we do add it, please can we double-check that in-CMS previews still work fine. |
There aren't but this also protects if a malicious script were to dynamically add a |
Right, I meant it as if we need to support any pre-existing values, or a wholesale I went with |
Description
This issue proposes adding the
base-uri
directive to our Content Security Policy (CSP) to enhance security by controlling the base URL used for resolving relative URLs in our web application. Thebase-uri
directive restricts where<base>
elements can point, helping mitigate certain types of injection attacks and preventing the unintended manipulation of relative URL resolution.Why Add
base-uri
?Mitigates Injection Attacks:
<base>
element into the HTML document, redirecting relative URLs (e.g., links, resources) to an unauthorized or malicious domain.Improves Application Integrity:
Aligns with Security Best Practices:
base-uri
to CSP strengthens the policy against attacks targeting URL resolution, complementing other directives likescript-src
andform-action
.The text was updated successfully, but these errors were encountered: