CVE-2026-115924 is a high-severity (CVSS 8.6) Path Traversal vulnerability in rembg. A fix is available for rembg — see the affected versions and patch details below.
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-115924.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
rembgReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
The public /api/remove endpoint uses attacker-controlled extras.sam_model in both SAM filenames and GitHub download URLs. Path traversal plus a URL fragment lets an unauthenticated attacker place malicious ONNX models beside a target file. The models read the file as ONNX external data and encode its bytes into the returned PNG.
This issue affects SAM's sam_model in 2.0.81 and returns complete file contents.
Screenshot 1 — First unauthenticated request primes the path and returns HTTP 500.
Technical details
rembg/commands/s_command.py:188-223,384-397 accepts public extras JSON and passes it to new_session(). rembg/sessions/sam.py:313-355 inserts sam_model into encoder/decoder filenames and fixed GitHub URLs, then invokes pooch.retrieve() without a pinned hash.
Requests removes the URL #fragment; the local POSIX path retains it. Pooch creates attacker-selected parent directories without enforcing cache containment. The first request creates the path tree and returns HTTP 500. The identical second request downloads the attacker asset twice and stores it as both SAM models beside the target.
The graph uses a relative external tensor to read the target and maps every byte to mask pixels. rembg returns the mask as a PNG, which the attacker decodes back into the original bytes.
<img width="2432" height="1254" alt="image" src="https://github.com/user-attachments/assets/99215c39-3619-4952-8f41-5ef2034f7499" />Screenshot 2 — The identical second request returns HTTP 200 with an encoded PNG.
<img width="2858" height="1548" alt="image" src="https://github.com/user-attachments/assets/26322071-101c-41aa-a356-08a4969ef475" />Proof of concept
The attached loopback-only PoC produced:
VULNERABLE: unauthenticated SAM model injection disclosed the synthetic /flag
first-http=500 second-http=200
decoded-value=REMBG_AUDIT_SYNTHETIC_FLAG_2026_08_28
The /etc/passwd variant produced:
VULNERABLE: disclosed /etc/passwd (839 bytes)
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
...
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
The decoded contents matched /etc/passwd inside the owned container. Testing used a local TLS stand-in for GitHub; no public target was contacted.
Screenshot 3 — The decoder reconstructs all 839 bytes of /etc/passwd.
Impact
An unauthenticated attacker can execute arbitrary ONNX computation and disclose complete files that rembg can reach under the required filesystem permissions. The supplied root-running container exposed both /flag and /etc/passwd.
Remediation
Allow only fixed SAM identifiers mapped server-side to fixed filenames, URLs, and pinned hashes. Reject path and URL syntax; canonicalize destinations and enforce cache containment before creating directories. Run the container as a non-root user with a read-only root filesystem.
decode_samfragment_png.py samfragment_04.py samfragment_etc_passwd_lab.py
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | rembg | all versions | 2.0.82pip install --upgrade 'rembg==2.0.82' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rembg, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update rembg to 2.0.82 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-115924 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is CVE-2026-115924 in your dependencies?
Find it across PyPI, including transitive dependencies.