Skip to content

In-depth lesson · technique

DOM-based XSS

What every disclosed DOM-based XSS 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
166

Learning Client-side in depth, step 1

Overview

What it is and why programs pay for it.

DOM-based cross-site scripting is a client-side flaw where untrusted data from a source such as the URL fragment, query string, referrer, postMessage data or localStorage is written into a dangerous sink like innerHTML or eval without proper handling. The browser then executes attacker-controlled script in the page's origin. Programs care because it can run in the context of their site, bypass server-side filters and sometimes evade CSP, and it has been reported across major properties including Google, Facebook, PayPal, Uber and NASA.

It usually leads to script execution on the affected origin, which can mean session theft, account takeover, data exfiltration or chaining with other issues such as clickjacking and CSRF. Some reports show it combined with clickjacking or CSRF, and others show it escalating to account takeover. It is most often found in search features, redirect and return URL parameters, postMessage handlers, third-party widgets and libraries, error pages, checkout and login flows, and pages that read from localStorage or the URL fragment.

The evidence covers a wide range of technologies and contexts, from AngularJS templates and Swagger UI to mermaid diagrams, browser extensions and mobile sites. It also appears in shared widgets that affect several sites, and in bundled third-party libraries. This breadth is why it is worth checking both first-party code and the components a site pulls in.

Seen in these reports14

Show 5 moreShow fewer

How it works

The mechanics, as the reports show them.

The flaw needs a source and a sink. A source is where attacker-influenced data enters the client, such as a URL fragment parameter, a query parameter, the referrer, a postMessage event, clipboard data or localStorage. A sink is a browser API that turns text into markup or code, such as innerHTML, script loaders, location assignment or eval. When data flows from a source to a sink without encoding, validation or safe APIs, script can run.

A common pattern is a URL fragment parameter assigned directly to innerHTML. Another is a URL parameter passed to a script loader such as jQuery's getScript without restricting the source. In both cases the page trusts data it should not, and the browser executes what the attacker supplies.

postMessage handlers are a frequent route. The page listens for messages and either fails to check the sender's origin or checks it with a prefix or substring match instead of an exact comparison. It then passes message data into innerHTML, location assignment or eval. This makes it possible for a malicious page to send crafted messages and trigger execution.

Client-side frameworks and template engines add their own paths. User input placed into an Angular template without sanitising expressions can be evaluated by Angular. A lodash template that fails to escape a value for an attribute context can inject into a template evaluated as JavaScript. Prototype pollution through URL parsing can also feed a gadget that later reaches eval or innerHTML.

Third-party components and libraries are another source. Outdated Swagger UI reads a configuration parameter and uses it without proper sanitisation. The mermaid diagram renderer has allowed javascript scheme links and unsanitised style injection. Bundled libraries and shared widgets can carry the flaw into many sites at once.

What makes it possible is the gap between where data enters and where it is used. Server-side filters do not see client-side flows, and some defences such as CSP or URL encoding may not apply in older browsers. Reports show retesting in Internet Explorer or Edge where a CSP-blocked payload executed, and bypassing origin checks by registering domains that match a prefix or substring.

Year by year

12 years

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

Reports per yearPeak 2025: 73
Reports per year
20011
20101
20111
20122
20143
20153
201615
201728
201814
201920
202034
202116
20227
202317
202432
202573
202662
  1. 2026

    62 reports

    New this year3

    • Using AngularJS $location.absUrl() propagation as a DOM XSS primitive was a new technique, as shown in the disclosed reports.
    • Testing a VOTable viewer for reflected DOM-based XSS with data exfiltration via same-origin XHR was novel, as shown in the disclosed reports.
    • Testing a publicly exposed shared-code feature in a 3D globe sandbox for DOM-based XSS was new, as shown in the disclosed reports.

    Kept working1

    • They tested a WordPress playground path under wp-includes for DOM-based XSS, as shown in the disclosed reports.

    Turned up less1

    • postMessage listener exploitation, common in 2024, was not reported, as shown in the earlier reports.

    Reports from 20264

    Every point and report from 2026
  2. 2025

    73 reports · median $4,000

    New this year1

    • Turning browser console input into DOM-based XSS was a new technique, as shown in the disclosed reports.

    Kept working3

    • Hunters found DOM-based XSS on NASA web properties, as shown in the disclosed reports.
    • They tested birthdate confirmation and thanks pages for DOM-based XSS, as shown in the disclosed reports.
    and 1 more

    Turned up less1

    • postMessage listener exploitation, common in 2024, was not reported, as shown in the earlier reports.

    Reports from 20255

    Every point and report from 2025
  3. 2024

    32 reports

    New this year1

    • A chatbot feature was identified as a place for unusual DOM-based XSS, as shown in the disclosed reports.

    Kept working3

    • They sent crafted messages to listeners on multiple domains and search engine pages to trigger DOM-based XSS, as shown in the disclosed reports.
    • Hunters pointed outdated Swagger UI configUrl parameters at external JSON files to run script, as shown in the disclosed reports.
    and 1 more

    Turned up less1

    • Open redirect to DOM-based XSS chains, seen in 2023, were not reported, as shown in the earlier reports.
Every point, year by year

Where it is found

57

The features and places the reports found it in, most-reported first.

  1. A DoD website had a DOM-based XSS flaw.

    Seen in 4 reports
  2. A NASA web property had a DOM-based XSS flaw.

    Seen in 3 reports
  3. A Google web property had a DOM-based XSS flaw.

    Seen in 1 report
  4. Facebook's FBML markup rendering was a place where DOM-based script injection could occur.

    Seen in 1 report
  5. AVG's web pages carried a DOM-based XSS flaw.

    Seen in 1 report
View all 57

Root causes

21

The mistakes in the code or configuration behind the reports.

  1. User input was placed into a client-side Angular template without sanitising template expressions, so Angular evaluated attacker-controlled expressions.

    Seen in 1 report
  2. A URL fragment parameter was assigned to innerHTML without encoding or validation.

    Seen in 1 report
  3. A lodash template used for the input modal failed to escape the value parameter for the data-define attribute context, letting an attacker inject into a twine template that was evaluated as JavaScript.

    Seen in 1 report
  4. A URL parameter was passed straight to jQuery's getScript without validating or restricting the script source.

    Seen in 1 report
  5. The application reflected the untrusted X-Forwarded-Host header into page attributes that drive a client-side fetch, and the fetched JSON was written into the DOM without escaping.

    Seen in 1 report
View all 21

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

postMessage and cross-window messaging

of 3 ticked
More in postMessage and cross-window messaging

Editors, markdown and rich content

of 3 ticked
More in Editors, markdown and rich content

Redirect and return URL parameters

of 3 ticked
More in Redirect and return URL parameters
View more things to try

Bypasses and variations

5

How reports got past filters, encoders and other defences.

  1. Retest a patched DOM-based XSS to find a bypass of the fix.

    Seen in 2 reports
  2. Bypass an origin check that compares only the start of the origin string by registering a domain whose name begins with the trusted origin.

    Seen in 1 report
  3. Bypass an origin check that uses a substring match by hosting the attacker page on a domain that contains the trusted origin string.

    Seen in 1 report
  4. Load AngularJS from an allowed CDN inside an injected iframe and use ng-on-error to run code past CSP.

    Seen in 1 report
  5. Bypass a WAF to deliver a DOM-based XSS on a government domain.

    Seen in 1 report

Payouts

43 paid

Public bounties in US dollars, from the data. 43 of 442 reports show an amount.

a quarter paid up to
$500
median
$1,000
three quarters paid up to
$3,000
highest
$20k

One in ten paid reports was paid $4,800 or more.

SeverityReportsPaidMedianHighest
Critical 4 0 None paid None
High 36 5 $2,500 $3,600
Medium 64 7 $1,000 $4,000
Low 30 8 $375 $500
Informational 6 0 None paid None
Unrated 302 23 $1,250 $20k

Highest-paid reports5

Tips for beginners

13

Advice for a first hunt, drawn from the reports.

  1. Start with the obvious sources: URL fragments, query parameters, redirect and return URL parameters, search boxes and error pages. Test whether values you control are reflected into the page and whether they reach a sink such as innerHTML. Reports show these are common places for DOM-based XSS.

    Seen in 5 reports
  2. Look at postMessage handlers. Check whether the listener verifies the sender's origin with an exact match and whether message data is written into the DOM or used as a URL. Prefix and substring checks are bypassable, and missing origin checks are a direct route to execution.

    Seen in 4 reports
  3. Review third-party components: outdated Swagger UI, mermaid diagrams, bundled libraries and shared widgets. These often have known DOM-based issues and can affect many sites. Test configuration parameters and diagram features where user content is rendered.

    Seen in 4 reports
  4. Retest fixes. A patched DOM-based XSS can often be bypassed, and reports show retesting to find a bypass of the fix. If a fix relies on an origin check, try domains that match a prefix or substring. If it relies on encoding, check other contexts.

    Seen in 4 reports
  5. Test redirect and return URL parameters carefully. These are common sources that flow into location assignment or HTML building. Check whether a javascript scheme or HTML is accepted, and whether the value is used in a client-side fetch or link attribute.

    Seen in 4 reports
View all 13

Guides and techniques

The best explainers, cheat sheets and technique posts on DOM-based XSS, from around the web.

Keep learning

Where this lesson fits, and what to read next.

How this is made: our model read every listed DOM-based XSS 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 175 reports. All DOM-based XSS reports.