"onstart" event for "marquee" bypasses 'unsafe-inline' CSP directive
A CSP policy that omits 'unsafe-inline' can be bypassed using the onstart event handler on a marquee element, allowing inline JavaScript to execute. An attacker could run script despite the intended restriction.
- Fixed in 13 days
- Paid in 22 days
- Disclosed after 13 days
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36
Steps to reproduce:
Open the following URL: data:text/html,<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-eval'"><marquee onstart="alert('test')"></marquee>
Actual results:
JavaScript code "alert('test')" will be executed, while "'inline-inline'" not specified in CSP policy.
Expected results:
_inline_ javascript code not executed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
What the attacker needed
Victim visits a crafted page; browser supports marquee onstart
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A Content Security Policy (CSP) is a rule set a website sends to the browser to say which scripts are allowed to run. One common rule blocks inline scripts, which are small bits of code written directly in the page. This report shows that a specific event on an old HTML element could still run inline code even when that rule was in place.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.