Lab: Reflected XSS protected by very strict CSP, with dangling markup attack
Summary: PortSwigger's lab demonstrates a form hijacking attack against a site using a strict CSP that blocks external subresources, exploiting a missing form-action directive to inject a button whose formaction points to an attacker-controlled exploit server. The attack uses formmethod="get" so the victim's CSRF token is included in the URL sent to the exploit server, letting the attacker exfiltrate the token and use it to authorize changing the victim's email to hacker@evil-user.net.
Bottom line: A CSP that blocks external subresources can still leave form submissions unrestricted, so a single injected button can hand an attacker the CSRF token needed to change a victim's account email.
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