Skip to content
Info disclosure Disclosed report

SRI ignores cross-origin restriction when 30x redirect is used for loading target resources

Muneaki Nishimura Follow

Originally disclosed on Mozilla

  • Fixed in 6 days
  • Paid in 8 days
  • Disclosed after 6 days
Text
User Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36

Steps to reproduce:

The W3C specification (below) of Subresouce Integrity requires UA to verify CORS headers while loading of cross-origin resources because there is a risk of cross-origin  data leakage.
http://www.w3.org/TR/SRI/#cross-origin-data-leakage

But the latest Firefox Nightly 43 ignores CORS headers if 30x redirector on the same origin is used for retrieving cross-origin resources.

Please see the following live demo.
http://mallory.csrf.jp/sri/


Actual results:

At line 6, a cross-origin JS file is loaded regardless of SRI, it's valid behavior.
<script src="http://alice.csrf.jp/sri/credential.js" integrity="sha256-fake" onload ="expected()" onerror="unexpected()"></script>

Howeverm at line 9, the same file is loaded through a 308 redirector on the same origin as HTML, then loading file is blocked by SRI. This behavior violates the W3C SRI specification.
<script src="redirector.php?u=http://alice.csrf.jp/sri/credential.js" integrity="sha256-fake" onload ="expected()" onerror="unexpected()"></script>



Expected results:

SRI should check CORS headers even when 30x redirector is used for loading cross-origin resources.

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

What is known

A medium-severity info disclosure bug in DOM: Security. Mozilla made it public on 26 August 2015.

About Info disclosure

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Info disclosure?

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

More by Muneaki Nishimura

View all

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