Lab: Stored XSS into onclick event with angle brackets and double quotes HTML-encoded and single quotes and backslash escaped
Summary: PortSwigger's Web Security Academy lab describes a stored cross-site scripting flaw in a comment feature, where the author name is reflected inside an onclick event handler attribute with angle brackets and double quotes HTML-encoded and single quotes and backslash escaped. The solution posts a comment with a random alphanumeric string in the Website input, intercepts the request in Burp Repeater, and injects the payload http://foo?'-alert(1)-' so that clicking the comment author name triggers an alert.
Bottom line: The lab shows that encoding angle brackets and double quotes while escaping single quotes and backslashes still leaves an onclick handler injectable through a JavaScript URL, so a filter tuned to those characters alone does not close the hole.
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