Skip to content
XSS Disclosed report Beginner

XSS vulnerability in video player page

The video player page built an image element by concatenating the image_src URL parameter directly into HTML, so a crafted value could break out of the attribute and inject script. In browsers that do not enforce the Content Security Policy header, an attacker could run script in the page context when a victim opens the crafted link.

guido Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 29 days
  • Disclosed after 59 days

Hello,

I found a XSS vulnerability in your site. Try this:

https://amp.twimg.com/amplify-web-player/prod/source.html?url=https%3A%2F%2Famp.twimg.com%2Fprod%2Fjson%2F2014%2F04%2F26%2F01%2F14b09302-2e2d-458d-9ffe-e8f665bcaac7%2Fe569bfc3-9e61-498d-812e-cc6b58fa1494.json&image_src=data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw%27onload%3D%27alert(1000)

In browsers which do not adequately support the Content Security Policy header, this will execute alert(1000).

According to this page not all browsers are supporting this yet: http://caniuse.com/contentsecuritypolicy, for instance my own Android phone seems to be vulnerable as I receive the alert when opening that URL.

It happens because of this in amplify-web-player.min.js:

this._$poster = $("<div class='poster-image-container'><img class='poster-image' src='" + h + "'><span class='glyphicon glyphicon-media-play' style='display:none'></span></div>"), this._$allControls = $("<div class='all-controls'></div>"), g.impression && g.impression(), e.container ? (this._$container = $(e.container), this._$container.addClass("amplify-container")) : (this._$container = $("<div id='container' class='amplify-container'></div>"), $("body").append(this._$container)), this.resize(e.width, e.height), this._$allControls.append(l), this._$allControls.append(f), this._$allControls.append(c), this._$allControls.show();

(The variable 'h' is loaded with the value of the image_src parameter in the URL).

I hope this was helpful to you.

Guido

The original report as published on HackerOne, by guido. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Root cause

The image_src parameter was concatenated unescaped into an HTML string used to build the poster image element.

Impact

Script could run in the player page for victims on browsers that do not enforce the CSP header; browsers with working CSP support would block it.

What the attacker needed

Victim opens a crafted link; browser lacks CSP support

The fix

The image_src value should be escaped or set via the DOM rather than concatenated into HTML.

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.

The page takes a value from the web address and pastes it straight into the HTML it builds for an image. By adding a quote and some extra text, an attacker can escape the image tag and add their own code, which the browser then runs. This is called cross-site scripting (XSS): running someone else's script inside a trusted site.

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 guido

View all

49 more disclosed reports, best first.

More from X / xAI

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.