GHSA-55v6-g8pm-pw4c: Rembg Rembg Server Is Vulnerable To Vulnerability

MODERATE
CVSS 4.3
CWE-918
Published
Advisory Summary

GHSA-55v6-g8pm-pw4c is a MODERATE (CVSS 4.3) rembg server is vulnerable to vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Rembg libraries in the PyPI ecosystem. The issue involves rembg server is vulnerable to server-side request forgery (ssrf) and a weak default cors configuration. Remediation is available by upgrading affected packages to version 2.0.75.

GHSA-55v6-g8pm-pw4c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-55v6-g8pm-pw4c
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Rembg
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-55v6-g8pm-pw4c

To remediate this vulnerability, upgrade all affected Rembg dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rembg fixed: 2.0.75
pip install rembg>=2.0.75
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show rembg

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-55v6-g8pm-pw4c, inspect your installed packages using pip:

pip show rembg

Analyze the terminal output to locate any version of Rembg in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.75), your application is affected.

Note: The pip show rembg command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Rembg, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# GitHub Security Lab (GHSL) Vulnerability Report, rembg: `GHSL-2024-161`, `GHSL-2024-162` The [GitHub Security Lab](https://securitylab.github.com) team has identified potential security vulnerabilities in [rembg](https://github.com/danielgatis/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](https://github.blog/2022-04-22-removing-the-stigma-of-a-cve/) 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](https://github.com/danielgatis/rembg/releases/tag/v2.0.57) ## Details ### Issue 1: SSRF via `/api/remove` (`GHSL-2024-161`) The [`/api/remove`](https://github.com/danielgatis/rembg/blob/d1e00734f8a996abf512a3a5c251c7a9a392c90a/rembg/commands/s_command.py#L237) 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. ```python 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](https://github.com/danielgatis/rembg/blob/d1e00734f8a996abf512a3a5c251c7a9a392c90a/rembg/commands/s_command.py#L93) 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. ```python 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: ```javascript 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](https://help.github.com/en/github/managing-security-vulnerabilities/creating-a-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](https://help.github.com/en/github/managing-security-vulnerabilities/publishing-a-security-advisory). ## Credit These issues were discovered and reported by GHSL team member [@Kwstubbs (Kevin Stubbings)](https://github.com/Kwstubbs). ## 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](https://securitylab.github.com/advisories#policy).

GHSA-55v6-g8pm-pw4c Affected Rembg Versions

1 component(s)
Fixed Versions:
2.0.75
Product / Package Ecosystem Affected Versions Fixed Version
rembg
PyPI
< 2.0.75
2.0.75

References

Frequently Asked Questions

What is GHSA-55v6-g8pm-pw4c?
GHSA-55v6-g8pm-pw4c is a security vulnerability in Rembg involving rembg server is vulnerable to Server-Side Request Forgery (SSRF) and a weak default CORS configuration under CWE-918: Server-Side Request Forgery (SSRF).
Which Rembg versions are affected?
Affected versions include releases prior to 2.0.75 across affected packages: rembg.
What version fixes GHSA-55v6-g8pm-pw4c?
Upgrading to 2.0.75 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rembg affected?
Yes, rembg is affected in releases prior to 2.0.75. Upgrade your dependency to 2.0.75 or later.
What is the CVSS score of GHSA-55v6-g8pm-pw4c?
GHSA-55v6-g8pm-pw4c has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-55v6-g8pm-pw4c?
GHSA-55v6-g8pm-pw4c is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for GHSA-55v6-g8pm-pw4c?
Run the dependency tree command: 'pip show rembg'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-55v6-g8pm-pw4c",
  "modified" : "2026-04-10T22:09:15Z",
  "published" : "2026-04-10T22:09:15Z",
  "aliases" : [ ],
  "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`\n\nThe [GitHub Security Lab](https://securitylab.github.com) team has identified potential security vulnerabilities in [rembg](https://github.com/danielgatis/rembg).\n\nWe 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.\n\nIf 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](https://github.blog/2022-04-22-removing-the-stigma-of-a-cve/) 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.\n\nIf you are _NOT_ the correct point of contact for this report, please let us know!\n\n## Summary\n\nrembg 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.\n\n## Project\n\nrembg\n\n## Tested Version\n\n[v2.0.57](https://github.com/danielgatis/rembg/releases/tag/v2.0.57)\n\n## Details\n\n### Issue 1: SSRF via `/api/remove` (`GHSL-2024-161`)\n\nThe [`/api/remove`](https://github.com/danielgatis/rembg/blob/d1e00734f8a996abf512a3a5c251c7a9a392c90a/rembg/commands/s_command.py#L237) 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.\n\n```python\n async def get_index(\n        url: str = Query(\n            default=..., description=\"URL of the image that has to be processed.\"\n        ),\n        commons: CommonQueryParams = Depends(),\n    ):\n        async with aiohttp.ClientSession() as session:\n            async with session.get(url) as response:\n                file = await response.read()\n                return await asyncify(im_without_bg)(file, commons)\n```\n\n#### Impact\n\nThis issue may lead to `Information Disclosure`.\n\n#### Remediation\n\nEnsure that the IP address specified is not a local address. If resolving a domain name, ensure that the resolved IP address is not local.\n\n#### Proof of Concept\n\n`curl -s \"http://localhost:7000/api/remove?url=http://0.0.0.0/secret.png\" -o output.png`\n\n\n### Issue 2: CORS misconfiguration (`GHSL-2024-162`)\n\nThe following [CORS middleware](https://github.com/danielgatis/rembg/blob/d1e00734f8a996abf512a3a5c251c7a9a392c90a/rembg/commands/s_command.py#L93) 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.\n\n```python\n    app.add_middleware(\n        CORSMiddleware,\n        allow_credentials=True,\n        allow_origins=[\"*\"],\n        allow_methods=[\"*\"],\n        allow_headers=[\"*\"],\n    )\n\n```\n\n#### Impact\n\nThis issue may increase the severity of other vulnerabilities.\n\n#### Remediation\n\nCreate an allowlist of specific endpoints that can send cross site requests to the rembg server.\n\n#### Proof of Concept\n\nAn attacker website can host the following code:\n```javascript\nconst response = await fetch(\"http://localhost:7000/api/remove?url=https://0.0.0.0/secret.jpg\");\n```\nIf 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.\n\n## GitHub Security Advisories\n\nWe recommend you create a private [GitHub Security Advisory](https://help.github.com/en/github/managing-security-vulnerabilities/creating-a-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](https://help.github.com/en/github/managing-security-vulnerabilities/publishing-a-security-advisory).\n\n## Credit\n\nThese issues were discovered and reported by GHSL team member [@Kwstubbs (Kevin Stubbings)](https://github.com/Kwstubbs).\n\n## Contact\n\nYou 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.\n\n## Disclosure Policy\n\nThis report is subject to a 90-day disclosure deadline, as described in more detail in our [coordinated disclosure policy](https://securitylab.github.com/advisories#policy).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "rembg"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.75"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/danielgatis/rembg/security/advisories/GHSA-55v6-g8pm-pw4c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/danielgatis/rembg/commit/07ad0d493057bddf821dcc3e2410eb7e065257c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/danielgatis/rembg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/danielgatis/rembg/releases/tag/v2.0.75"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T22:09:15Z",
    "nvd_published_at" : null
  }
}