Cyber Risks · PortSwigger Research

JSON hijacking for the modern web

Summary: PortSwigger researcher Gareth Heyes documented cross-domain data theft using JavaScript proxies to overwrite the __proto__ chain and capture undefined variables, working on Edge via Object.setPrototypeOf and on Chrome 53 five levels deep into the prototype chain. He also showed that the UTF-16BE charset attribute on script tags lets attackers turn JSON feeds and HTML documents into valid JavaScript variables, enabling data theft and bypassing CSP policies that allow same-domain scripts, with the Chrome issue fixed in version 54 and PHP later defaulting to UTF-8 for text/html.

Why it matters: The attack needs no control over most of the response in Chrome, and a CSP that permits same-domain scripts was bypassed by treating an HTML document as a JavaScript variable, so a policy most organizations rely on did not stop the data theft.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related