Cyber Risks · PortSwigger Research

Noscript XSS filter bypass

Summary: PortSwigger researcher Gareth Heyes found a bypass of the Noscript XSS filter in script context by injecting ',__defineSetter__('x',alert),x=1,' which calls the setter on the window object and fires alert when x is assigned. He also showed that swapping alert for eval and the assignment for name lets a payload be carried across domains via the window.name property; the filter has since been patched and the vector no longer works.

Bottom line: The bypass relied on a built-in JavaScript method, __defineSetter__, that the filter's authors had not accounted for - a reminder that client-side XSS filters are denylists, and a single forgotten method or property is enough to defeat them.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related