Skip to content
DoS Disclosed report Intermediate CVE-2017-7837

SVG image can be used to set cookie

An SVG image served with a Content-Disposition attachment header could still set cookies for the hosting domain, because the earlier Firefox fix only blocked cross-domain cookie setting. An attacker could use this to set many cookies and make the victim's site return a bad request, a cookie bomb.

Jun Follow

Originally disclosed on Mozilla

  • Fixed in 8 months
  • Paid in 8 months
  • Disclosed after 8 months
Text
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Steps to reproduce:

1. Go to https://jsfiddle.net/26nLj6mL/1/
2. Now go to https://shhnjk.com/


Actual results:

https://shhnjk.com/ is not accessible and says "Bad request" due to Cookie bomb. Same attack can be done from https://vuln.shhnjk.com/svg_data.html.


Expected results:

Cookie should not be set by SVG image. Fix of https://insert-script.blogspot.ae/2016/12/firefox-svg-cross-domain-cookie.html only prevented setting cross domain cookie. But if site hosted svg image who has content disposition: attachment specified would be affected too. Same for the site who allows data URI in img tag.

The original report as published on Mozilla's Bugzilla, by Jun. 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 browser still allowed an SVG loaded as an image to set cookies for the domain hosting it, because the earlier fix only addressed cross-domain cookie setting.

Impact

The target site could become inaccessible to the victim with a bad request error, and the same attack could work on sites that host such an SVG or allow data URIs in image tags.

What the attacker needed

Victim visits attacker-controlled page; site hosts an SVG with attachment header

How it was found

  1. Open the provided test page that hosts the SVG.
  2. Visit the target site and observe it returns a bad request because of the cookie bomb.

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 cookie is a small piece of data a website stores in your browser. A cookie bomb means an attacker forces your browser to store so many cookies for a site that the site rejects your requests as too large. Here an image file (SVG) was able to set those cookies even though it was meant to be downloaded, not run.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Jun

View all

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

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.