Lab: Reflected XSS with AngularJS sandbox escape and CSP
Summary: This PortSwigger lab requires a cross-site scripting attack that bypasses CSP, escapes the AngularJS sandbox, and alerts document.cookie. The exploit uses the ng-focus event to trigger a focus event that bypasses CSP, then abuses the $event.path array and the orderBy filter to call alert in the scope of the window without an explicit window reference.
What's compelling: AngularJS's window check and a CSP header are two separate defenses, and this lab shows both falling to a single payload built from the framework's own event and filter mechanics.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026