Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 976

Prototype Pollution

Reviewed byCybersecurity entrepreneur & security researcher

What is Prototype Pollution?

Prototype PollutionA JavaScript vulnerability where untrusted input modifies Object.prototype, injecting properties into every object and changing application behaviour or leading to RCE.


Prototype pollution exploits JavaScript's prototype chain: by setting keys like __proto__, constructor.prototype, or prototype during merge, clone, or assign operations, an attacker mutates Object.prototype so that every plain object created afterwards inherits those injected properties. The bug typically hides in recursive merge utilities, deep-clone helpers, query-string parsers (qs, querystring), and template engines that accept user-controlled JSON.

Impact scales with how the polluted property is later read. A bare pollution gives denial of service or logic tampering (forcing isAdmin, flipping feature flags), but when the gadget feeds a command or template sink it escalates to remote code execution.

Named incidents and references

  • lodash — CVE-2019-10744 (CVSS 9.1). The defaultsDeep function could be coerced into writing to Object.prototype via a constructor payload. It affected every app transitively depending on lodash < 4.17.12; the fix shipped in 4.17.12.
  • Kibana — CVE-2019-7609 (CVSS 10.0). Michał Bentkowski showed that a Timelion prototype-pollution gadget chained into full RCE as the Kibana process. Patched in 5.6.15 / 6.6.1 and later added to CISA's Known Exploited Vulnerabilities catalogue (Jan 2022).

How the mutation propagates

flowchart LR
  A[Untrusted JSON<br/>__proto__.isAdmin=true] --> B[Vulnerable deep-merge]
  B --> C[Object.prototype mutated]
  C --> D[Every object inherits isAdmin]
  D --> E{Property read in<br/>security decision?}
  E -->|yes| F[Auth bypass / RCE gadget]
  E -->|no| G[Logic tampering / DoS]

Mitigations: reject __proto__/constructor/prototype keys on input, store untrusted maps in a Map or Object.create(null), call Object.freeze(Object.prototype) at startup, validate against a strict schema, and keep merge libraries patched. Node 13+ also blocks __proto__ in some built-in parsers, but application-level filtering remains essential.

● Examples

  1. 01

    POSTing {"__proto__":{"isAdmin":true}} to a JSON merge endpoint and gaining admin everywhere.

  2. 02

    Polluting prototype to alter template rendering options and trigger RCE.

● Frequently asked questions

What is Prototype Pollution?

A JavaScript vulnerability where untrusted input modifies Object.prototype, injecting properties into every object and changing application behaviour or leading to RCE. It belongs to the Vulnerabilities category of cybersecurity.

What does Prototype Pollution mean?

A JavaScript vulnerability where untrusted input modifies Object.prototype, injecting properties into every object and changing application behaviour or leading to RCE.

How do you defend against Prototype Pollution?

Defences for Prototype Pollution typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Prototype Pollution?

Common alternative names include: Object.prototype pollution, __proto__ injection.

● Related terms

● See also