OWASP Hunting

Injection

Prototype Pollution

Prototype pollution injects properties into JavaScript's Object.prototype, enabling denial of service, property injection, or in some cases RCE.

Payloads are read from main at 35c1f2b (committed 22 Nov 2026). Project version 1.0.2.

These payloads are for authorized testing only: systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.

Payload files

Folder on GitHub

Use the arrow keys to move between payloads. Press Enter or C to copy the focused payload.

prototype-pollution-payloads.txt

79 payloads · 5.7 KB
Source

Loading payloads for Prototype Pollution…

What it is#

Prototype pollution is a JavaScript vulnerability where an attacker injects properties into Object.prototype via untrusted input. Because nearly every JavaScript object inherits from Object.prototype, a polluted property affects the entire application. Impact ranges from denial of service and property injection to authentication bypass and remote code execution depending on how polluted properties are consumed.

Attack vectors#

  • JSON/query bodies parsed with unsafe merge utilities (lodash.merge, jQuery.extend)
  • URL/query string parsers that decode __proto__ or constructor keys
  • Custom recursive object assignment functions
  • YAML parsers that honor object keys verbatim

Testing methodology#

  1. Send JSON with __proto__ key: {"__proto__": {"polluted": true}}
  2. Try constructor.prototype path: {"constructor": {"prototype": {"polluted": true}}}
  3. Test URL query strings: ?__proto__[polluted]=1
  4. Check if ({}).polluted === true after the request
  5. Identify sinks that consume the polluted property for security decisions

Indicators of vulnerability#

  • Object.prototype properties set after sending crafted request
  • Application behavior changes when prototype properties are injected
  • Error messages referencing __proto__ or prototype in stack traces

Detection guidance#

Freeze Object.prototype in application startup. Audit all uses of merge, clone, and deep-copy utilities for prototype pollution vulnerabilities.

Mitigation and remediation#

  • Use Object.freeze(Object.prototype) at application startup
  • Use Object.create(null) for dictionaries that should not inherit from Object.prototype
  • Audit and patch merge/clone utilities to check for __proto__ and prototype keys
  • Validate that JSON keys do not include __proto__, constructor, or prototype
  • Use libraries patched against prototype pollution

References#

Responsible Use

All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.

  • Systems and applications you own
  • Authorized penetration testing engagements
  • Bug bounty programs with defined scope
  • Educational lab environments (DVWA, WebGoat, HackTheBox)