Tips

Prototype pollution tips

Prototype pollution lets input add properties to JavaScript’s Object prototype, changing how the rest of the code behaves. In the browser it can lead to XSS; on the server, to changed permissions or code execution.

Published tips, newest first. Payloads and commands are shown as plain text.

  • Test Prototype Pollution In Deep Property Stores

    When testing a target's deep property store, such as POST /api/preferences, try sending a payload with a path like ["__proto__", "role"] and includeInheritedProps set to true. This can bypass strict string comparison blocklists and pollute Object.prototype if the code uses the in

    Prototype pollutionExploitation

Prototype pollution: how to hunt it

Where to look

  • Query strings and JSON merged deeply, tried with __proto__[x]=y or constructor[prototype][x]=y.
  • Client-side gadgets: libraries that read an option and write it into the page.
  • Server-side merges into configuration or user objects, probed with a harmless property: pollution lasts until the process restarts.
  • Signs of pollution, such as a property appearing on every new object.

What proves it

Show the polluted property reaching a gadget with a real effect, such as script running or a changed response, not only that the prototype changed.

Read further

Writeups on Prototype pollution, by hunters and researchers, most with a short summary.

Related classes