Skip to content
Access control Disclosed report Advanced CVE-2014-0508

Flash local-with-fileaccess Sandbox Bypass

A Flash applet could bypass the local-with-fileaccess sandbox by encoding ignored file:// URI characters and using a decoder script to read arbitrary local files. An attacker could also download remote files to a predictable location and read them, potentially accessing webmail or XSRF tokens.

staatseigendom Follow

Originally disclosed on HackerOne

  • Fixed in 55 days
  • Paid in 55 days
  • Disclosed after 55 days

The proof of concept attached will exploit the implementation of flash in some browsers that will bypass the local-with-fileaccess sandbox. By encoding in ignored file:// uri characters, and navigating to another page with a decoder script. one is able to read arbitrary files AND parse it to the parent page, bypassing the local sandbox. The flash applet has a default mode in which it will parse file content and another mode (by setting flashvars) that will parse the length of the content of a file. And iframe within those 2 makes sure that the original window is persistent and the applet in the iframe will only move the iframe, the data is then passed by localstorage, and if recieved by poc.html, the iframe is reset. A quick overview of what the poc is doing, in which order. -Determine the length of the content from the file through the flash applet with mode 2 -Determine the maximum amount of space which can be used for leaking the data (chrome uses a max of 260) -Since every character uses 8 bits, divide that amount by 8, set as maximum chars in one 'transmission'. -Determine how much 'transmissions are needed' to get the entire file -Walk through file to get the entire file by appending all requested parts to variable 'total' -Call whatever callback function back.

Demonstrated in poc2.html: -The impact of this attack is increased by the ability to download arbitrary remote files (Cross origin) by systematically downloading those files to a know predictable location. (using the download= attribute in a <a >tag). This link will be automatically clicked. Now as long as the user is opening the file from a Drive:/User/Username location. We can simply predict the path to read the downloaded file on windows vista+ (Or any other OS with a default download folder for that matter). -This stage of exploitation enables an attacker to access a file with the auth of the user the following 'attack use cases' arise:

  1. Attacker could access and send users web-mail to his sown erver. (try using 'https://mail.google.com/mail/u/0/feed/atom' in poc2 while logged in with gmail)
  2. Attacker could get XSRF-tokens. To bypass such protections.

I could imagine there are countless other possibilities. -You might notice that loading the Hackerone page is painfully slow. However, In targeted attacks a attacker could filter the desirable data in the flash applet itself.

Now for the exploit itself, I acknowledge that the exploit might look very complex. Which is why I added a 'frontend' that is tested under the following conditions. OS:Windows 8 Browser: Google Chrome 32.0.1700.107 m

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

Likely the Flash local-with-fileaccess sandbox did not properly handle ignored characters in file:// URIs, allowing navigation to a decoder page that could read and relay file contents.

Impact

An attacker could read arbitrary local files and remote files downloaded to a predictable location, potentially accessing the user's webmail or XSRF tokens, though the exploit was demonstrated only on Windows 8 with Google Chrome 32.

What the attacker needed

Flash applet with local-with-fileaccess; Victim uses a browser with the flaw; Victim opens a malicious page; Predictable download folder path

How it was found

  1. Determine the length of the file content using the Flash applet in mode 2.
  2. Determine the maximum amount of space available for leaking data (Chrome uses a max of 260).
  3. Divide that amount by 8 to set the maximum characters per transmission.
  4. Calculate how many transmissions are needed to get the entire file.
  5. Walk through the file by appending all requested parts to a variable.
  6. Call the callback function.

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.

Flash had a security mode that was supposed to stop a web page from reading files on your computer. This report shows a way to get around that restriction, so a malicious page could read local files and even files it tricked your browser into downloading.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by staatseigendom

View all

3 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.