Skip to content
CORS Disclosed report Advanced

Several CORS security issues in browsers and specs, asking for comments

The report describes that CORS relaxes cross-origin write privileges and creates risky trust dependencies, leading to misconfigurations. An attacker could use a malicious website to send crafted requests via CORS, potentially achieving remote code execution on an internal server or creating files on a victim's local file system.

Jianjun Chen Follow

Originally disclosed on Mozilla

  • Fixed in 4 months
  • Paid in 11 months
  • Disclosed after 4 months
Text
Created attachment 8960923
CORS-paper.pdf

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36
Firefox for Android

Steps to reproduce:

Hello,

I'm Jianjun Chen from Tsinghua University. Recently we conducted a security analysis on CORS(Cross Origin Resource Sharing) protocol and discovered a number of new CORS-related security issues. We tested mainstream browsers and found Firefox browser is affected.(See details in the attached paper)

The issues can be classified into three categories: 1) CORS relaxes the cross-origin “write” privilege in a number of subtle ways that are problematic in practice; 2) CORS brings new forms of risky trust dependencies into web interactions; 3) CORS is generally not well understood by developers, possibly due to its inexpressive policy and its complex and subtle interactions with other web mechanisms, leading to various misconfigurations.

Here are two demo videos of CORS-related attacks in Google drive:

[1] https://drive.google.com/open?id=11f010CZLojF2d_3Sa--QYs0vzY3bdVJA
[2] https://drive.google.com/open?id=0ByM36MBckzBaUmtnVmlfdXNlcHc

The first video demonstrated that malicious websites can launch RCE attacks on victim's internal server by crafting a malicious Content-Type header through CORS interfaces and exploiting Apache struts s2-045 vulnerability(CVE-2017-5638). 

The second video demonstrated that malicious websites can create a new file in victim's local file system, by exploiting Mac's built-in Apple file server. 

For more technical details and other cases, please refer to the attached paper.

Note that those cases in the paper are some examples,  we believe there are many other similar CORS exploits in the real world.

As many of those problems are not just implementation flaws, but fundamental issues in CORS protocol, we would like to hear your thoughts or comments, especially how to mitigate those attacks.

Thanks very much~

Jianjun Chen

The original report as published on Mozilla's Bugzilla, by Jianjun Chen. 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 the CORS protocol allows cross-origin write operations and creates trust dependencies that developers often misconfigure.

Impact

A malicious website could launch remote code execution on a victim's internal server or create a file on the victim's local file system, though the report only demonstrates these with specific vulnerable servers.

What the attacker needed

Victim visits a malicious website; internal server runs vulnerable software

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.

CORS is a browser rule that lets a website ask another website for data. This report says the rule also lets a malicious site send certain requests to other sites, which can be dangerous if those sites trust the request. The author shows examples where this could let an attacker run code on an internal server or create a file on a victim's computer.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.