CVE-2026-115924
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
Archived. This CVE has left SubZer0's live 30-day window. Signals below are as of 2026-11-26; check the references for anything newer.
- Severity: High
- CVSS 8.6
- EPSS 0.50%
- Public exploit
- P2 · This week
Why P2: this week.
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. <img width="2172" height="1182" alt="image" src="https://github.com/user-attachments/assets/70aacab1-5ef8-4aad-b30e-e3780adef4d2" /> *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" al…
Affected products
- pip rembg < 2.0.82; first patched: 2.0.82
References
- GitHub security advisory GitHub
- Advisory reference GitHub
- Advisory reference GitHub
- Advisory reference GitHub
- Advisory reference GitHub