Skip to content
XSS Disclosed report Intermediate CVE-2016-9895

"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.

Andrew Follow

Originally disclosed on Mozilla

  • Fixed in 13 days
  • Paid in 22 days
  • Disclosed after 13 days
Text
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.

The original report as published on Mozilla's Bugzilla, by Andrew. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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.

More by Andrew

View all

3 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.