Cyber Risks · PortSwigger Research

XSS without HTML: Client-Side Template Injection with AngularJS

Summary: PortSwigger researcher Gareth Heyes documented Angular Template Injection, where user input embedded in an AngularJS template can execute expressions inside double curly braces even when HTML-encoded, and combined it with a new sandbox escape affecting Angular 1.3.1+ and 1.4.0+. The escape worked by overwriting native JavaScript functions such as String.fromCharCode and charAt to break the Angular sanitizer and inject code into the rewritten expression, and it was privately reported to Google on 25 September 2015 and patched in version 1.5.0 on 15 January 2016.

Key Takeaway: Angular's own documentation says the sandbox "is not intended to stop attackers," and the framework removed it entirely as of version 1.6 - so any team treating an Angular upgrade as the fix for expression injection is relying on a control the vendor never claimed would hold.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related