GHSA-55v6-g8pm-pw4c

Suggest an improvement
Source
https://github.com/advisories/GHSA-55v6-g8pm-pw4c
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-55v6-g8pm-pw4c/GHSA-55v6-g8pm-pw4c.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-55v6-g8pm-pw4c
Published
2026-04-10T22:09:15Z
Modified
2026-04-10T22:17:48.332110Z
Severity
  • 4.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N CVSS Calculator
Summary
rembg server is vulnerable to Server-Side Request Forgery (SSRF) and a weak default CORS configuration
Details

GitHub Security Lab (GHSL) Vulnerability Report, rembg: GHSL-2024-161, GHSL-2024-162

The GitHub Security Lab team has identified potential security vulnerabilities in rembg.

We are committed to working with you to help resolve these issues. In this report you will find everything you need to effectively coordinate a resolution of these issues with the GHSL team.

If at any point you have concerns or questions about this process, please do not hesitate to reach out to us at securitylab@github.com (please include GHSL-2024-161 or GHSL-2024-162 as a reference). See also this blog post written by GitHub's Advisory Curation team which explains what CVEs and advisories are, why they are important to track vulnerabilities and keep downstream users informed, the CVE assigning process, and how they are used to keep open source software secure.

If you are NOT the correct point of contact for this report, please let us know!

Summary

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.

Project

rembg

Tested Version

v2.0.57

Details

Issue 1: SSRF via /api/remove (GHSL-2024-161)

The /api/remove endpoint takes a URL query parameter that allows an image to be fetched, processed and returned. An attacker may be able to query this endpoint to view pictures hosted on the internal network of the rembg server.

 async def get_index(
        url: str = Query(
            default=..., description="URL of the image that has to be processed."
        ),
        commons: CommonQueryParams = Depends(),
    ):
        async with aiohttp.ClientSession() as session:
            async with session.get(url) as response:
                file = await response.read()
                return await asyncify(im_without_bg)(file, commons)

Impact

This issue may lead to Information Disclosure.

Remediation

Ensure that the IP address specified is not a local address. If resolving a domain name, ensure that the resolved IP address is not local.

Proof of Concept

curl -s "http://localhost:7000/api/remove?url=http://0.0.0.0/secret.png" -o output.png

Issue 2: CORS misconfiguration (GHSL-2024-162)

The following CORS middleware is setup incorrectly. All origins are reflected, which allows any website to send cross site requests to the rembg server and thus query any API. Even if authentication were to be enabled, allow_credentials is set to True, which would allow any website to send authenticated cross site requests.

    app.add_middleware(
        CORSMiddleware,
        allow_credentials=True,
        allow_origins=["*"],
        allow_methods=["*"],
        allow_headers=["*"],
    )

Impact

This issue may increase the severity of other vulnerabilities.

Remediation

Create an allowlist of specific endpoints that can send cross site requests to the rembg server.

Proof of Concept

An attacker website can host the following code:

const response = await fetch("http://localhost:7000/api/remove?url=https://0.0.0.0/secret.jpg");

If a victim running rembg server were to access the attacker website, the attacker website could read the file secret.jpg from the server hosted on the victim's internal network.

GitHub Security Advisories

We recommend you create a private GitHub Security Advisory for these findings. This also allows you to invite the GHSL team to collaborate and further discuss these findings in private before they are published.

Credit

These issues were discovered and reported by GHSL team member @Kwstubbs (Kevin Stubbings).

Contact

You can contact the GHSL team at securitylab@github.com, please include a reference to GHSL-2024-161 or GHSL-2024-162 in any communication regarding these issues.

Disclosure Policy

This report is subject to a 90-day disclosure deadline, as described in more detail in our coordinated disclosure policy.

Database specific
{
    "cwe_ids": [
        "CWE-918"
    ],
    "github_reviewed_at": "2026-04-10T22:09:15Z",
    "nvd_published_at": null,
    "severity": "MODERATE",
    "github_reviewed": true
}
References

Affected packages

PyPI / rembg

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.0.75

Affected versions

2.*
2.0.28
2.0.29
2.0.30
2.0.31
2.0.32
2.0.33
2.0.34
2.0.35
2.0.36
2.0.37
2.0.38
2.0.39
2.0.40
2.0.41
2.0.43
2.0.44
2.0.45
2.0.46
2.0.47
2.0.48
2.0.49
2.0.50
2.0.51
2.0.52
2.0.53
2.0.54
2.0.55
2.0.56
2.0.57
2.0.58
2.0.59
2.0.60
2.0.61
2.0.62
2.0.63
2.0.64
2.0.65
2.0.66
2.0.67
2.0.68
2.0.69
2.0.70
2.0.71
2.0.72
2.0.73
2.0.74

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-55v6-g8pm-pw4c/GHSA-55v6-g8pm-pw4c.json"