Skip to content

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

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

Show 5 moreShow fewer

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.

Year by year

9 years

What each year's disclosed reports show, newest first. A year with few reports says less.

Reports per yearPeak 2026: 63
Reports per year
20142
20153
20168
201719
20188
20199
202021
202118
202225
202313
202430
202561
202663
  1. 2025

    61 reports

    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.
    and 1 more

    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.
    and 4 more
  2. 2024

    30 reports · median $3,000

    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.
    and 4 more
  3. 2023

    13 reports · median $7,500

    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.
    and 4 more
Every point, year by year

Root causes

36

The mistakes in the code or configuration behind the reports.

  1. The label colour value from imported data was inserted into the page without sanitisation.

    Seen in 2 reports
  2. The Markdown renderer turned escaped characters inside angle-bracket autolinks into live markup rather than keeping them encoded.

    Seen in 1 report
  3. The admin panel rendered a merchant-supplied details value without HTML-encoding it, and the policy still allowed inline script.

    Seen in 1 report
  4. 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
  5. 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
View all 36

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

Other

of 3 ticked
More in Other

Browser builds and engines

of 3 ticked
  • Seen in 4 reports
  • Seen in 1 report
  • Seen in 1 report
More in Browser builds and engines

Email and webmail clients

of 3 ticked
More in Email and webmail clients

Comments, issues and autocomplete

of 3 ticked
More in Comments, issues and autocomplete
View more things to try

Bypasses and variations

5

How reports got past filters, encoders and other defences.

  1. Load an old AngularJS build from an allowed CDN and use its expression evaluation to run code under the policy.

    Seen in 3 reports
  2. Use DOM clobbering to defeat the policy and read the CSRF token from the page.

    Seen in 3 reports
  3. Use a JavaScript-scheme follow-up URL to run script even where the policy would block inline script.

    Seen in 1 report
  4. 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
  5. The strict-dynamic policy allowed the externally loaded script, so the bypass could amplify any existing XSS.

    Seen in 1 report

Payouts

46 paid

Public 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.

SeverityReportsPaidMedianHighest
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

Tips for beginners

11

Advice for a first hunt, drawn from the reports.

  1. 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
  2. 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.

    Seen in 2 reports
  3. 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
  4. 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
  5. 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.

    Seen in 2 reports
View all 11

Guides and techniques

The best explainers, cheat sheets and technique posts on CSP bypass, from around the web.

Keep learning

Where this lesson fits, and what to read next.

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.