Case A5AFA0 · Web AppSec · L4 Advanced

Prototype Pollution

Practise as: Deep diveLevel: L4 Advanced
  1. 01 Context
  2. 02 Mechanism
  3. 03 Lessons
What a strong answer covers

Try it out loud first. Then check yourself:

  1. Objects inherit from Object.prototype; a merge or clone that writes __proto__ or constructor.prototype pollutes every object
  2. Sources: JSON bodies, query-string parsers, URL fragments; the bug needs a gadget, code that reads a property it never set
  3. Client side: gadgets in libraries turn pollution into DOM XSS, e.g. a polluted config property flowing into innerHTML
  4. Server side (Node): gadgets like child_process options (shell, env, NODE_OPTIONS) can reach RCE; also auth bypass or DoS
  5. Defend: block __proto__/constructor keys, Object.create(null) or Map for lookups, schema validation, node --disable-proto

If the interviewer pushes back

  • How would you detect server-side prototype pollution in a black-box test without crashing the app?

Go deeper

More Web AppSec cards

All Web AppSec cards →

cardosec draws a security topic and gives you a clock: explain it out loud with no notes, then see what you covered and what you missed. Free during early access.

Reviewed 2026-10-09