Skip to content

In-depth lesson · bug class

Prototype pollution

What every disclosed Prototype pollution 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
53

Learning Prototype pollution reading list Client-side in depth, step 5

Overview

What it is and why programs pay for it.

Prototype pollution is a vulnerability where an attacker can add or modify properties on the shared prototype of objects in JavaScript (and similar object models in other languages). Because many objects inherit from that prototype, a single polluted property can affect every plain object in the application. Programs care because this can lead to serious consequences such as denial of service, DOM cross-site scripting, and even remote code execution, depending on how the polluted property is later used. The evidence shows reports across npm packages, server-side Node applications, client-side web front ends, and other technologies.

In practice, prototype pollution often arises when libraries or application code merge, extend, clone, or set nested properties using attacker-controlled keys without blocking special key names. The reports in the evidence include many npm packages that perform these operations, such as dot-prop, object-path-set, extend-merge, klona, and jQuery's extend. It also appears in server-side code that recursively merges JSON, in XML parsing libraries, and in features like Kibana's telemetry collector and GitLab's Mermaid directives. The impact ranges from observable side effects and denial of service to code execution, and it is frequently found in widely used transitive dependencies.

Seen in these reports12

Show 5 moreShow fewer

How it works

The mechanics, as the reports show them.

The core mechanism is that an attacker supplies a key or path that names the prototype (for example, a key that resolves to the prototype object) to a function that assigns or merges properties. If the function does not reject such keys, the assignment lands on the shared prototype instead of on the intended object. Once a property is set on the prototype, every object that inherits from it will appear to have that property, which can change application behaviour in unexpected ways.

Many libraries that set values at a dotted or array property path are vulnerable because they walk the path and create intermediate objects without checking whether a segment refers to the prototype. Similarly, recursive merge and extend helpers copy properties from a source object to a target; if the source contains a prototype-named key, the merge can write to the prototype. Clone and config-merge utilities can also be affected if they copy properties without filtering special keys.

The problem is made possible by the dynamic nature of JavaScript objects and the fact that the prototype chain is mutable. Developers often assume that user input will only contain ordinary keys, so they do not sanitise key names. Even when a library is not directly exposed to user input, it may be used as a transitive dependency in an application that passes attacker-controlled data into it. The evidence includes reports against widely downloaded npm packages and common gadgets reused across many applications.

On the server side, prototype pollution can be detected through observable side effects rather than crashing the process. For example, a crafted request might change responses or behaviour in a way that indicates a property was added to the prototype. In some cases, the polluted property becomes a gadget that is later evaluated as code, leading to remote code execution. The evidence includes server-side pollution in Node applications, Blitz.js, and Ruby applications that recursively merge user-supplied JSON.

On the client side, prototype pollution can lead to DOM cross-site scripting when a sink reads a property from the prototype and turns it into markup or script. Attackers can pollute a property through a query or fragment parameter, and the effect may persist across reloads or navigation if stored state is involved. The evidence includes client-side pollution leading to DOM XSS in web front ends and HTML injection reached through prototype pollution.

Other variations include XML parsing libraries that build objects from parsed input, where element or attribute names aimed at the prototype can pollute the parsed object. jQuery's extend function used to merge user-supplied objects is another vector, and gadgets that read a polluted property can turn it into script execution or DOM changes. The evidence also notes prototype-style pollution in Python object handling leading to denial of service, and in protobufjs message parsing.

Seen in these reports23

Show 5 moreShow fewer

Year by year

6 years

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

Reports per yearPeak 2020: 21
Reports per year
20011
20111
20121
20131
201814
20194
202021
202115
202211
202311
202411
20257
202612
  1. 2023

    11 reports

    New this year3

    • Black-box detection of server-side pollution without causing denial of service became a focus.
    • They chained a server-side pollution into code execution without relying on the filesystem.
    • They polluted a property that EJS reads during rendering and checked whether it reached code execution.

    Kept working5

    • Hunters found server-side prototype pollution in Node applications, including detection without denial of service.
    • They reviewed recursive merge and dynamic assignment code for missing checks on special key names.
    and 3 more

    Turned up less2

    • XML parsing libraries, which were reported in 2022, were less prominent in the 2023 reports.
    • Blitz.js request path pollution, which was reported in 2022, was not represented in the 2023 reports.
  2. 2022

    11 reports

    New this year3

    • XML parsing libraries such as fast-xml-parser and xml2js that build objects from parsed input appeared as a new sink.
    • Node's console.table property handling was reported as a pollution vector.
    • Blitz.js applications, where prototype pollution led to remote code execution, were reported.

    Turned up less2

    • Deep clone and object utility packages, which were a focus in 2020 and 2021, were not represented in the 2022 reports.
    • Client-side DOM XSS chains, which were prominent in 2021, were not represented in the 2022 reports.

    Reports from 20221

  3. 2021

    15 reports · median $4,000

    New this year3

    • Client-side prototype pollution leading to DOM XSS in web front ends appeared as a distinct pattern.
    • Kibana's SIEM signal feature, which merged machine-learning anomaly influencer field names into objects, was reported.
    • Mermaid diagram directives in GitLab issues, where a directive JSON object is merged into config, were reported.

    Kept working3

    • Hunters ran a clone or config-merge call over an object containing a prototype-named key and checked whether the clone's prototype was altered.
    • They targeted deep clone and object utility packages such as klona, chart.js config handling, i18next, noble and firebase util.
    and 1 more

    Turned up less1

    • Path-setting helpers, which were prominent in 2018 and 2020, were not represented in the 2021 reports.
Every point, year by year

Where it is found

20

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

  1. Libraries that set a value at a dotted or array property path, such as dot-prop, object-path-set, nested-property, ts-dot-prop, property-expr, keyd, objtools, mpath, utils-extend, extend-merge, supermixer, json8-merge-patch and plain-object-merge.

    Seen in 13 reports
  2. Object merge and extend helper packages on npm, where recursive merging of attacker-controlled keys reaches the prototype.

    Seen in 10 reports
  3. Deep clone and object utility packages such as klona, chart.js config handling, i18next, noble and firebase util.

    Seen in 5 reports
  4. Server-side prototype pollution in Node applications, including detection without denial of service.

    Seen in 3 reports
  5. Client-side prototype pollution leading to DOM XSS in web front ends.

    Seen in 2 reports
View all 20

Root causes

4

The mistakes in the code or configuration behind the reports.

  1. A dangerous nested-property setter was used on telemetry document fields, letting a crafted field name reach the prototype.

    Seen in 1 report
  2. Attacker-controlled field names were merged without blocking special keys, and the polluted value was later evaluated as code.

    Seen in 1 report
  3. The directive JSON was merged into config without sanitisation, so a prototype key modified the shared prototype.

    Seen in 1 report
  4. The recursive merge blindly set instance variables and singleton accessors from attacker-controlled keys.

    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

Client-side sinks and DOM

of 3 ticked

Language-specific runtimes

of 3 ticked

Other

of 3 ticked

Authorisation and method overrides

of 2 ticked
View more things to try

Bypasses and variations

1

How reports got past filters, encoders and other defences.

  1. Try to get a prototype-named key past a web application firewall on a client-side sink.

    Seen in 1 report

Payouts

5 paid

Public bounties in US dollars, from the data. 5 of 127 reports show an amount.

a quarter paid up to
$3,000
median
$5,000
three quarters paid up to
$10k
highest
$100k

One in ten paid reports was paid $64k or more.

SeverityReportsPaidMedianHighest
Critical 21 2 $7,500 $10k
High 36 1 $3,000 $3,000
Medium 14 0 None paid None
Low 10 1 $200 $200
Informational 2 0 None paid None
Unrated 44 1 $100k $100k

Tips for beginners

14

Advice for a first hunt, drawn from the reports.

  1. Start by looking for libraries and application code that merge, extend, clone, or set nested properties using user-controlled keys. The evidence lists many npm packages and patterns, such as dot-prop, object-path-set, extend-merge, klona, and jQuery's extend. Focus on places where input from query parameters, JSON bodies, or XML is passed into these functions.

    Seen in 5 reports
  2. When testing a merge or extend helper, feed a nested key named for the prototype and check whether a property appears on all plain objects afterwards. For path-setting helpers, pass a path whose first segment names the prototype and see whether the assignment lands on the shared prototype. Always verify the effect on the prototype itself, not just on the returned object.

    Seen in 4 reports
  3. Review recursive merge and dynamic assignment code for missing checks on special key names. Manual code review of merge and assignment logic in server code is a reliable way to find these issues, especially in Ruby applications that recursively merge user-supplied JSON into object attributes.

    Seen in 3 reports
  4. Look for gadgets that can escalate prototype pollution to code execution. For example, pollute a property that EJS reads during rendering, or a property used in an authorisation check, and see whether it reaches code execution or grants access. The evidence includes chaining server-side pollution into code execution without relying on the filesystem.

    Seen in 3 reports
  5. Test XML parsing libraries by sending XML with element or attribute names aimed at the prototype and checking the parsed object's prototype. Libraries such as fast-xml-parser and xml2js build objects from parsed input and may be vulnerable if they do not filter special keys.

    Seen in 2 reports
View all 14

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on Prototype pollution, from around the web.

Keep learning

Where this lesson fits, and what to read next.

How this is made: our model read every listed Prototype pollution 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 53 reports. All Prototype pollution reports.