Prototype pollution occurs when attacker-controlled keys are merged into JavaScript objects in a way that modifies properties inherited through the prototype chain. Keys such as __proto__ or constructor.prototype can be involved when unsafe recursive merge or configuration code processes untrusted input. The pollution may become exploitable when application code later reads an inherited property in a sensitive operation; impact can range from unexpected behaviour to client-side XSS or more serious server-side consequences, depending on the vulnerable code and gadget. Defences include strict allowlists for accepted keys, avoiding unsafe merges of untrusted objects, using Map or null-prototype dictionaries where appropriate, freezing sensitive prototypes when compatible, and patching vulnerable libraries. A blocklist for only __proto__ is not sufficient because alternate paths may exist. Source: PortSwigger Web Security Academy.