Case A5AFA0 · Web AppSec · L4 Advanced
Prototype Pollution
- 01 Context
- 02 Mechanism
- 03 Lessons
What a strong answer covers
Try it out loud first. Then check yourself:
- Objects inherit from Object.prototype; a merge or clone that writes __proto__ or constructor.prototype pollutes every object
- Sources: JSON bodies, query-string parsers, URL fragments; the bug needs a gadget, code that reads a property it never set
- Client side: gadgets in libraries turn pollution into DOM XSS, e.g. a polluted config property flowing into innerHTML
- Server side (Node): gadgets like child_process options (shell, env, NODE_OPTIONS) can reach RCE; also auth bypass or DoS
- 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?