Cyber Risks · PortSwigger Research

Prototype pollution via browser APIs

Summary: PortSwigger research describes widespread prototype pollution gadgets in common browser JavaScript APIs, including the Fetch API, where polluting Object.prototype with a headers property can be inherited by the options object passed to fetch() and used to generate a request. The research also shows that using Object.defineProperty() as a mitigation can be bypassed by polluting Object.prototype with a value property, which is inherited by the descriptor object.

Key Takeaway: The defense many developers reach for against prototype pollution - Object.defineProperty() - can itself be defeated through the same mechanism, so code that appears hardened against DOM XSS may still be exploitable.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related