Cyber Risks · PortSwigger Research

Lab: Client-side prototype pollution via browser APIs

Summary: PortSwigger Research published a lab demonstrating DOM XSS via client-side prototype pollution, in which developers noticed a potential gadget and patched it by using Object.defineProperty() to make the transport_url property unwritable and unconfigurable, but failed to define a value property. Injecting a value property through the query string causes a script element with a src attribute to be rendered on the page, and a data: URL payload calls alert(1).

What's compelling: The patch here looks like a fix - the property is locked down - yet the missing value definition leaves the gadget exploitable, so a control that appears to close a DOM XSS path can still be bypassed by anyone who reads the code closely enough.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related