In-depth lesson · technique
CSP bypass
What every disclosed CSP bypass report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- reports cited in this lesson
- 102
- median public bounty
- $2,470
Learning Client-side in depth, step 3
Overview
What it is and why programs pay for it.
Content Security Policy (CSP) is a browser defence that restricts which scripts can run on a page. A CSP bypass is any technique that gets script to execute despite the policy, usually by abusing a weakness in the policy itself, a flaw in how the site applies it, or a gadget in an allowed script. Bug bounty programs care because a bypass turns a limited injection into full script execution, which can lead to account takeover, data theft, or actions performed as the victim. The reports here show that bypasses are often the difference between a low-impact finding and a serious one.
This lesson is based on 110 reports, 50 with summaries and 27 paid. The evidence covers a wide range of root causes, from missing output encoding to misconfigured policies and sanitiser quirks. The common thread is that a defence was present but could be circumvented, often because of a small oversight. The reports show that bypasses are found in many contexts: web applications, desktop apps built on Electron, mobile browsers, and even browser features like reader mode.
CSP bypasses most often appear where user-supplied content is rendered, such as comments, issue titles, wiki pages, and profile fields. They also turn up in integrations and proxies that handle third-party content, and in features that rely on client-side rendering or sandboxed iframes. The evidence includes cases in code hosting platforms, e-commerce admin panels, online office suites, and chat clients. Because the policy is often the last line of defence, any place that reflects or stores input is a potential target.
Seen in these reports12
-
$6,000 -
$1,000 Medium -
$500 Low
Show 5 moreShow fewer
-
$500 Low -
$350 Medium -
High -
Medium -
Medium
How it works
The mechanics, as the reports show them.
A CSP bypass starts with an injection point: a place where an attacker can get markup or script into a page. The policy is meant to stop that script from running, so the attacker looks for a way around it. The evidence shows many root causes: unescaped user input inserted into HTML, sanitisers that fail to handle certain characters, and policies that allow dangerous sources. For example, a label colour value from imported data was inserted without sanitisation, and a Markdown renderer turned escaped characters into live markup.
Once injection is possible, the attacker examines the policy for weaknesses. Common issues include missing directives (such as base-uri or form-action), overly broad allowlists (such as allowing a CDN that hosts AngularJS), and reliance on nonces that can be read by allowed scripts. The reports show bypasses using DOM clobbering, JavaScript URLs, and gadgets in allowed libraries. For instance, an allowed analytics script bundled AngularJS, and Angular expressions could read the nonce and reuse it.
Another path is to abuse the way the policy is delivered or applied. If an attacker can influence the policy header itself, for example through a proxy that caches responses with attacker-supplied headers, they can relax the rules. Similarly, a service worker path traversal or a misconfigured proxy can serve attacker-controlled HTML from the same origin, bypassing the policy entirely. The evidence includes a proxy that allowed caching of responses with attacker-supplied policy headers and a service worker that allowed path traversal.
Sanitiser bypasses are a major category. Sanitisers try to remove dangerous markup, but they can be tricked by parser differences, type confusion, or incomplete filtering. The reports show a custom ignore-tag callback that let tag-like strings through because its parsing differed from the browser's, and a type confusion where a string 'false' took the unsafe path. Other examples include a regex that allowed any character except double quotes and a filter that did not sanitise the alt attribute when replacing an image with a link.
Finally, browser-specific behaviour and features can be exploited. Some bypasses rely on the browser's built-in XSS filter, reader mode, or extension mechanisms. The reports include testing browser-specific policy bypasses against current builds, using reader mode to run script, and checking whether a mobile browser enforces the policy at all. These techniques often require reporting the browser version and may be considered out of scope for some programs, so hunters should check the program's rules.
Seen in these reports14
-
High -
$5,000 High -
$1,250 High
Show 5 moreShow fewer
-
$1,000 Medium -
$500 Low -
High -
Low -
High
Year by year
9 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2014 | 2 |
|---|---|
| 2015 | 3 |
| 2016 | 8 |
| 2017 | 19 |
| 2018 | 8 |
| 2019 | 9 |
| 2020 | 21 |
| 2021 | 18 |
| 2022 | 25 |
| 2023 | 13 |
| 2024 | 30 |
| 2025 | 61 |
| 2026 | 63 |
-
2025
New this year4
- The dependency proxy was pointed at an attacker server so it cached a response with an attacker policy header, then tested in Firefox.
- An SVG containing a form was hosted on the asset proxy to check whether the proxied content's policy blocked form submissions.
- An HTML file uploaded as a model artifact was served inline through the proxy endpoint with a redirect header.
Kept working6
- Markdown, diagram and reference rendering on a code hosting platform repeatedly produced stored XSS with a policy bypass.
- The markdown placeholders feature was enabled with a scoped label and a tag whose name contained markup, and the rendered output was viewed.
-
2024
New this year2
- DOM clobbering, postMessage and service worker tricks were increasingly chained with the policy bypass.
- With HTML injection already available, an allowed third-party script bundling AngularJS was used to read the page nonce and load a script.
Kept working6
- Markdown, diagram and reference rendering on a code hosting platform repeatedly produced stored XSS with a policy bypass.
- DOM clobbering was used to override a variable the policy relied on and bypass it.
-
2023
New this year3
- Desktop mail clients and Electron apps where a parsing flaw led to sandbox and policy bypass and then code execution became a recurring theme.
- A hidden AngularJS gadget in an analytics product was found and used to bypass the policy, including by loading an old AngularJS build from an allowed CDN.
- Markup stored through a GraphQL mutation was checked for execution when rendered, chaining to account takeover.
Kept working6
- Markdown, diagram and reference rendering on a code hosting platform repeatedly produced stored XSS with a policy bypass.
- Crafted emails sent to a webmail client were tested for a parsing issue letting script escape the message sandbox.
Earlier years6
Root causes
36The mistakes in the code or configuration behind the reports.
-
The label colour value from imported data was inserted into the page without sanitisation.
Seen in 2 reports
-
The Markdown renderer turned escaped characters inside angle-bracket autolinks into live markup rather than keeping them encoded.
Seen in 1 report
-
The admin panel rendered a merchant-supplied details value without HTML-encoding it, and the policy still allowed inline script.
Seen in 1 report
-
$350 Medium
-
-
A query parameter was reflected into the HTML response without output encoding, and the payload was shaped to evade the CDN filter.
Seen in 1 report
-
The message listener did not check the sender origin and passed an attacker-controlled follow-up URL straight into a location assignment without validating the scheme.
Seen in 1 report
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Browser builds and engines
of 3 ticked-
Seen in 4 reports
-
Seen in 1 report
-
$1,000 Medium
-
-
Seen in 1 report
Email and webmail clients
of 3 ticked-
Seen in 3 reports
-
Seen in 1 report
-
Seen in 1 report
Comments, issues and autocomplete
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
-
Seen in 1 report
Bypasses and variations
5How reports got past filters, encoders and other defences.
-
Load an old AngularJS build from an allowed CDN and use its expression evaluation to run code under the policy.
Seen in 3 reports
-
Use DOM clobbering to defeat the policy and read the CSRF token from the page.
Seen in 3 reports
-
Use a JavaScript-scheme follow-up URL to run script even where the policy would block inline script.
Seen in 1 report
-
The sanitiser allowed only a strong tag but still permitted data attributes, which a UI framework turned into an interactive popover loading an external script.
Seen in 1 report
-
The strict-dynamic policy allowed the externally loaded script, so the bypass could amplify any existing XSS.
Payouts
46 paidPublic bounties in US dollars, from the data. 46 of 387 reports show an amount.
- a quarter paid up to
- $1,000
- median
- $2,470
- three quarters paid up to
- $7,125
- highest
- $35k
One in ten paid reports was paid $14k or more.
| Severity | Reports | Paid | Median | Highest |
|---|---|---|---|---|
| Critical | 11 | 1 | $16k | $16k |
| High | 56 | 5 | $5,000 | $14k |
| Medium | 51 | 11 | $1,000 | $3,000 |
| Low | 20 | 4 | $750 | $1,000 |
| Informational | 3 | 0 | None paid | None |
| Unrated | 246 | 25 | $6,000 | $35k |
Highest-paid reports5
-
$35,000 -
$20,000 -
$16,000 Critical -
$15,300 -
$15,000
Tips for beginners
11Advice for a first hunt, drawn from the reports.
-
Look for gadgets in allowed scripts. If the policy allows a third-party library, see if it can be abused to execute code. The reports show AngularJS being used as a gadget, and an analytics script that could be repurposed for exfiltration. Check for known vulnerable libraries and whether their expressions can read the nonce.
Seen in 3 reports
-
Start by understanding the policy in place. Use browser developer tools to inspect the Content-Security-Policy header and note which directives are present or missing. Look for weak policies such as those allowing unsafe-inline, broad script-src lists, or missing base-uri and form-action. The evidence shows that missing directives like base-uri and form-action were key to bypasses.
-
Look for injection points first. Any place that reflects or stores user input is a candidate: comments, titles, filenames, profile fields, and imported data. The reports include many examples, such as a comment text inserted without escaping and a filename not sanitised in an error message. Test with benign markup to see if it renders, then consider whether a bypass is needed.
Seen in 2 reports
-
Check for sanitiser weaknesses. Try inputs that exploit parser differences, such as unusual tag structures or encoded characters. The evidence shows a sanitiser bypass using a tag that differed between the sanitiser's parser and the browser's. Also test type confusion, like setting a value to the string 'false' where a boolean is expected.
Seen in 2 reports
-
Test DOM clobbering. This technique can override variables that the policy relies on, or that the page uses for security decisions. The evidence includes using DOM clobbering to defeat the policy and read a CSRF token. Look for named elements that could shadow global variables.
Guides and techniques
The best explainers, cheat sheets and technique posts on CSP bypass, from around the web.
-
Inside the Script Block: JavaScript String, Template Literal, and JSON BreakoutsExplains how to break out of JavaScript strings, template literals and JSON inside script blocks to achieve XSS.
Technique kd-200.medium.com
-
Self-XSS Is Not a Dead End: Five Ways to Deliver It to Someone ElseShows five delivery methods that turn a self-XSS into a reportable issue by getting another user to trigger the payload.
Technique kd-200.medium.com
-
Hunting down subdomain takeover vulnerabilitiesExplains how to spot and confirm subdomain takeovers, automate detection and escalate them into token leaks, CSRF, CORS and CSP bypasses.
Methodology intigriti.com
-
Bypassing Content Security Policy (CSP)Explains CSP directives and practical bypasses including report-only mode, weak sources, predictable nonces and injection.
Explainer intigriti.com
-
CSP Recon: Reading a Policy Like a HunterExplains how to read Content Security Policy headers to spot weaknesses useful for cross-site scripting exploitation.
Technique kd-200.medium.com
Keep learning
Where this lesson fits, and what to read next.
Learning paths
The whole class
Related techniques
How this is made: our model read every listed CSP bypass report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 26 Nov 2026 from 110 reports. All CSP bypass reports.