Apex › Security & web

Prototype pollution

How attacker JSON reaches JavaScript's shared prototype and changes the behavior of objects it never touched. A naive deep-merge follows __proto__ — or constructor.prototype, the very same object reached by a key a __proto__-only filter never checks — onto the shared prototype, so a brand-new empty object suddenly inherits the attacker's properties: an auth bypass hiding in plain sight. Try both attack vectors, toggle vulnerable vs safe merge, and watch a fresh {} become admin. (Sandboxed — never touches the real prototype.)

More in Security & web