Bug class · Advanced
Prototype pollution
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.
- median public bounty
- $5,000
- highest public bounty
- $100k
How it works
Full lessonThe pattern behind every report in this class.
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.
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.
Things to try
All 27Each line worked in a disclosed report. Test only what a program's scope allows.
Client-side sinks and DOM 3
- Look for a client-side sink that reads a property from the prototype and turns it into markup or script, then pollute that property through a query or fragment parameter.
- Add a Mermaid diagram with a directive that sets a prototype-named key in an issue, save it and open the issue to see whether the page breaks.
- Pollute a property that a page later renders as HTML and check whether injected markup appears.
Language-specific runtimes 3
- Send JSON with keys naming instance variables or methods into a recursive merge and check whether the object's behaviour changes.
- Send nested keys aimed at class attributes in a Python service and check for altered behaviour or a crash.
- Pollute a property in a Blitz.js request path and check whether it reaches code execution.
Other 3
- Pass an object with prototype-named properties to console.table and check whether the prototype is modified.
- Review recursive merge and dynamic assignment code for missing checks on special key names.
- Do not rely only on automated scanners; manually verify suspected pollution points that tools miss.
Stored and persistent pollution 3
- Index a document whose field names target the prototype in a telemetry collector, then wait for collection or restart the service to trigger it.
- Write a crafted influencer field name into an anomaly index, import a detection rule that uses it, enable the rule and wait for evaluation.
- Check whether a client-side pollution survives a reload or navigation, for example through stored state, and whether it can be re-triggered later.
jQuery and legacy frameworks 3
- Send a nested object with a prototype-named key into a jQuery extend call and check whether the resulting object has a polluted property.
- Look for jQuery gadgets that read a polluted property and turn it into script execution or DOM changes.
- Check whether an old AngularJS build is loaded in production and whether its merge helpers can be reached from user input.
Bypasses and variations
- Try to get a prototype-named key past a web application firewall on a client-side sink.
Tips for beginners
All 14- 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.
- 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.
- For server-side targets, detect pollution through observable side effects rather than crashing the process. Look for changed responses or behaviour after a crafted request, and avoid denial-of-service style tests that could disrupt the service. The evidence includes detection without denial of service as a specific technique.
- On the client side, look for a sink that reads a property from the prototype and turns it into markup or script, then pollute that property through a query or fragment parameter. Check whether the pollution survives a reload or navigation, for example through stored state, and whether it can be re-triggered later. This can turn prototype pollution into DOM XSS.
- 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.
- 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.
Start here: a reading path
Open the pathClear reports in order, easiest first.
-
1
[ts-dot-prop] Prototype PollutionBeginner
The set function does not block or sanitise the __proto__ key when traversing a dot-notation path, allowing writes to Object.prototype.
-
2
[extend-merge] Prototype pollutionBeginner
The merge function allows keys like __proto__ to modify Object.prototype.
-
3
Prototype pollution attack (merge.recursive)Beginner
Likely the merge.recursive function does not filter or block the __proto__ key when recursively merging objects, allowing it to modify Object.prototype.
-
4
[keyd] Prototype pollutionBeginner
The set function does not properly validate or block the special __proto__ key, allowing modification of Object.prototype.
-
5
[object-path-set] Prototype pollutionBeginner
Likely the setPath function does not block or sanitise special path segments such as __proto__, constructor, or prototype, allowing assignment to Object.prototype.
-
6
[json8-merge-patch] Prototype PollutionBeginner
The apply function does not block the special __proto__ key when merging objects, so it writes to the prototype instead of the object itself.
-
7
[plain-object-merge] Prototype pollutionBeginner
Likely the merge routine recursed into the __proto__ key of the input object instead of skipping or blocking it, letting the write reach Object.prototype.
-
8
[objtools] Prototype pollutionBeginner
The merge function copies a __proto__ key from input onto Object.prototype rather than only the target object.
Guides and techniques
View allThe best explainers, cheat sheets and technique posts on Prototype pollution, from around the web.
-
ServerSide Prototype Pollution ScannerPortSwigger releases a scanner for server side prototype pollution, letting hunters detect gadget based flaws automatically.
portswigger.net
-
White-box penetration testing: How to debug for JavaScript vulnerabilitiesDemonstrates debugging a JavaScript app in VS Code to trace prototype pollution payloads through filters during white box testing.
Methodology yeswehack.com
-
Server side prototype pollution, how to detect and exploitWalks through server-side prototype pollution, showing how to detect it in black-box testing and find gadgets for exploitation.
Technique yeswehack.com
-
The Bug Bounty Hunter’s Guide to Prototype PollutionExplains client side prototype pollution, how it arises and how hunters can spot and exploit it.
Explainer meetcyber.net
-
JavaScript type confusion: Bypassed input validation (and how to remediate)Explains how JavaScript type confusion can slip past input validation and outlines remediation steps for developers.
Explainer snyk.io
Highest paid
View allThe biggest public bounties for Prototype pollution.
-
$100,000 -
Remote Code Execution on Cloud via latest Kibana 7.6.2Critical Elastic HackerOne
$10,000 -
Remote Code Execution in coming Kibana 7.7.0Critical Elastic HackerOne
$5,000 -
Stored XSS via Mermaid Prototype Pollution vulnerabilityHigh GitLab HackerOne
$3,000 -
$200
Newest reports
All 127Most recently disclosed.
-
-
-
-
Insufficient validation of untrusted input in DevTools (CVE-2026-13968)Medium Google Chrome Advisory
-
Inappropriate implementation in Serial (CVE-2026-12459)High Google Chrome Advisory
-
-
-
-
-
New Prototype pollution reports by email
Follow Prototype pollution and get each week's new disclosures in one short email.