Skip to content
Info disclosure Disclosed report Intermediate CVE-2016-9900

SVG-as-an-image sends requests for external files, if they're included in a data URI

An SVG loaded through an img tag is supposed to be blocked from fetching external resources, but when the SVG references a second SVG through a fill attribute using a data URI, Firefox still fetches remote files. An attacker could use this to leak information about the victim, such as their IP address, to a third party.

insertscript Follow

Originally disclosed on Mozilla

  • Fixed in 8 days
  • Paid in 28 days
  • Disclosed after 8 days
Text
Created attachment 8812820
svg_leak_poc.zip

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce:

Tested: 
Windows 8.1 - Firefox Nightly 53.0a1
Windows 7 - 50.0


SVG images loaded via an img tag are restricted on the support for external resources.
See Bug https://bugzilla.mozilla.org/show_bug.cgi?id=628747

This restriction fails as soon as the SVG file loads a second SVG file via the fill attribute.
Note that it could be that other SVG attributes could be used as well, I haven't checked all of them so far. 

As soon as the second SVG is parsed, Firefox fetches different remote resources. 
The PoC will load different resources from example.com to proof that.
Additionally the data: protocol was used inside the fill attribute, to have the PoC in one place.


Actual results:

After the SVG was rendered remote files are fetched.


Expected results:

Taking into consideration that developers assume that images can not trigger different connections to external resources, this could cause privacy issues.

The original report as published on Mozilla's Bugzilla, by insertscript. 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 restriction on external resource loading for SVG images was only applied to the top-level SVG and not to a nested SVG referenced through the fill attribute.

Impact

Because developers assume images cannot trigger external connections, this could cause privacy issues by letting a rendered image contact remote servers.

What the attacker needed

Victim views a page with the crafted SVG; Firefox browser

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.

Websites often show images from other places, and browsers try to stop those images from quietly contacting other servers so they cannot track you. Here, a special kind of image (SVG, a picture described in code) could sneak in a second image that made the browser contact an outside server anyway. That means a page could learn things about you, like your network address, just by showing you a picture.

What is Info disclosure?

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

More by insertscript

View all

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