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

GREATUK-1191 Implement 2024 penetration test recommendation #3649

Merged

Conversation

hal274
Copy link
Contributor

@hal274 hal274 commented Nov 14, 2024

What

2024 penetration test recommendation suggest we update the content security policy to prevent inline javascripts from executing

Why

The CSP specification2 states that developers should not use as it enables XSS attacks by allowing code to be included directly into the document.3 Furthermore, the usage of should also be disallowed, since eval is considered a bad practice, opening up the possibility of code injection.

Furthermore, several third party domains were allowlisted within the policy. Every allowisted domain undermines the CSP and potentially allows for exploitation of XSS vulnerabilities which would otherwise not have been exploitable. In particular, several allowlisted domains ( and ) were known to allow various CSP bypasses.4 5 6

Recommendation

Review the CSP’s configuration to implement the best practices as described by the specification.7 8 9 10

Content Security Policy Specification: Content Security Policy Level 3

The unsafe-inline Source List Keyword unsafe-inline ⟶ CSP Guide

Workflow

Reviewing help

  • Explains how to test locally, including how to set up appropriate data
  • Where a PR contains code changes developed or maintained by multiple squads a representative from those squads should review the PR.

Merging

  • This PR can be merged by reviewers. (If unticked, please leave for the author to merge)

@hal274 hal274 requested a review from a team as a code owner November 14, 2024 13:42
@hal274 hal274 merged commit 7fe4668 into develop Nov 15, 2024
11 checks passed
@hal274 hal274 deleted the feature-GREATUK-1191-address-pentest-2024-finding-on-csp branch November 15, 2024 09:58
hal274 added a commit that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants