GHSL-2024-161_GHSL-2024-162: Server-Side Request Forgery (SSRF) and a weak default CORS configuration in rembg - CVE-2025-25301, CVE-2025-25302
The rembg server's image-processing endpoint fetched any URL supplied by the caller, so an attacker could make the server retrieve images from hosts on its internal network. A permissive CORS setup also reflected every origin and allowed credentials, letting any website call the server's APIs.
rembg server is vulnerable to Server-Side Request Forgery (SSRF) and a weak default CORS configuration, which may allow an attacker website to send requests to servers on the internal network and view image responses.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
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
The endpoint passed a user-supplied URL straight into an outbound HTTP request without validating the destination, and the CORS middleware combined a wildcard origin with credential support.
Impact
An attacker could read images hosted on the internal network, and the CORS flaw may increase the severity of other vulnerabilities.
What the attacker needed
Rembg server reachable by attacker; internal host serving images
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.
The rembg server has an endpoint that takes a web address, downloads the image there and removes its background. Because it never checked where that address pointed, someone could ask it to fetch pictures from machines inside the company network that outsiders cannot reach, and the processed result would leak them back. Separately, the server told every website it was allowed to make requests to it, so a malicious page could quietly use the server on a visitor's behalf.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.