CVE-2026-115924
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
Rembg is a tool to remove images background. Prior to 2.0.82, the public /api/remove endpoint passes attacker-controlled extras.sam_model through rembg/commands/s_command.py to rembg/sessions/sam.py, where it is interpolated into SAM filenames and GitHub download URLs passed to pooch.retrieve() without a pinned hash. An unauthenticated attacker can supply a sam_model value combining path traversal with URL fragment syntax to exploit the HTTP request discarding the fragment while the local POSIX path retains it. The first request primes the attacker-selected path tree, and an identical repeated request downloads malicious ONNX encoder and decoder files beside a readable target file. The graphs can load the target through ONNX external data and encode its bytes into the returned PNG mask, disclosing complete files accessible to the rembg process and allowing arbitrary ONNX computation. This issue is fixed in version 2.0.82.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
8.6
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
Rembg is a tool to remove images background. Prior to 2.0.82, the public /api/remove endpoint passes attacker-controlled extras.sam_model through rembg/commands/s_command.py to rembg/sessions/sam.py, where it is interpolated into SAM filenames and GitHub download URLs passed to pooch.retrieve() without a pinned hash. An unauthenticated attacker can supply a sam_model value combining path traversal with URL fragment syntax to exploit the HTTP request discarding the fragment while the local POSIX path retains it. The first request primes the attacker-selected path tree, and an identical repeated request downloads malicious ONNX encoder and decoder files beside a readable target file. The graphs can load the target through ONNX external data and encode its bytes into the returned PNG mask, disclosing complete files accessible to the rembg process and allowing arbitrary ONNX computation. This issue is fixed in version 2.0.82.
- Record
CVE-2026-115924- CVSS 3.1
- 8.6 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2026-110073
8.6
Rembg is a tool to remove images background. Prior to 2.0.82, the public /api/remove endpoint passes attacker-controlled extras.sam_model through rembg/commands/s_command.py to rembg/sessions/sam.py, where it is interpolated into SAM filenames and GitHub download URLs passed to pooch.retrieve() without a pinned hash. An unauthenticated attacker can supply a sam_model value combining path traversal with URL fragment syntax to exploit the HTTP request discarding the fragment while the local POSIX path retains it. The first request primes the attacker-selected path tree, and an identical repeated request downloads malicious ONNX encoder and decoder files beside a readable target file. The graphs can load the target through ONNX external data and encode its bytes into the returned PNG mask, disclosing complete files accessible to the rembg process and allowing arbitrary ONNX computation. This issue is fixed in version 2.0.82.
- Record
EUVD-2026-110073- CVSS 3.1
- 8.6 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-qr6x-7v33-6qmg
8.6
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
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" 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.
<img width="1816" height="1146" alt="image" src="https://github.com/user-attachments/assets/664eaf25-5963-4ca6-b7eb-3e198499194a" />
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
- Record
GHSA-qr6x-7v33-6qmg- CVSS 3.1
- 8.6 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
8.6
Rembg is a tool to remove images background. Prior to 2.0.82, the public /api/remove endpoint passes attacker-controlled extras.sam_model through rembg/commands/s_command.py to rembg/sessions/sam.py, where it is interpolated into SAM filenames and GitHub download URLs passed to pooch.retrieve() without a pinned hash. An unauthenticated attacker can supply a sam_model value combining path traversal with URL fragment syntax to exploit the HTTP request discarding the fragment while the local POSIX path retains it. The first request primes the attacker-selected path tree, and an identical repeated request downloads malicious ONNX encoder and decoder files beside a readable target file. The graphs can load the target through ONNX external data and encode its bytes into the returned PNG mask, disclosing complete files accessible to the rembg process and allowing arbitrary ONNX computation. This issue is fixed in version 2.0.82.
- Record
CVE-2026-115924- CVSS 3.1
- 8.6 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-22
- Updated
- 2026-11-02
OSV
8.6
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
Rembg is a tool to remove images background. Prior to 2.0.82, the public /api/remove endpoint passes attacker-controlled extras.sam_model through rembg/commands/s_command.py to rembg/sessions/sam.py, where it is interpolated into SAM filenames and GitHub download URLs passed to pooch.retrieve() without a pinned hash. An unauthenticated attacker can supply a sam_model value combining path traversal with URL fragment syntax to exploit the HTTP request discarding the fragment while the local POSIX path retains it. The first request primes the attacker-selected path tree, and an identical repeated request downloads malicious ONNX encoder and decoder files beside a readable target file. The graphs can load the target through ONNX external data and encode its bytes into the returned PNG mask, disclosing complete files accessible to the rembg process and allowing arbitrary ONNX computation. This issue is fixed in version 2.0.82.
- Record
CVE-2026-115924- CVSS 3.1
- 8.6 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVGHSA-qr6x-7v33-6qmg
8.6
Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
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" 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.
<img width="1816" height="1146" alt="image" src="https://github.com/user-attachments/assets/664eaf25-5963-4ca6-b7eb-3e198499194a" />
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
- Record
GHSA-qr6x-7v33-6qmg- CVSS 3.1
- 8.6 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-22
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
rembgPyPI |
before 2.0.82 | 2.0.82 |
rembgPyPI |
before 2.0.82, plus listed versions 2.0.282.0.292.0.302.0.312.0.32 Show 45 moreShow less2.0.332.0.342.0.352.0.362.0.372.0.382.0.392.0.402.0.412.0.432.0.442.0.452.0.462.0.472.0.482.0.492.0.502.0.512.0.522.0.532.0.542.0.552.0.562.0.572.0.582.0.592.0.602.0.612.0.622.0.632.0.642.0.652.0.662.0.672.0.682.0.692.0.702.0.712.0.722.0.732.0.742.0.752.0.762.0.772.0.78 |
2.0.82 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-115924 is a high vulnerability (CVSS 8.6) in Danielgatis Rembg, published October 26, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.39%, the 33rd percentile. Fixed in rembg 2.0.82.
References
github.com/danielgatis/rembg/security/advisories/GHSA-qr6x-7v33-6qmg
github.com/danielgatis/rembg/commit/b2758c6b39bb2b02df90a03128110339476984d3
github.com/danielgatis/rembg/releases/tag/v2.0.82
nvd.nist.gov/vuln/detail/CVE-2026-115924
github.com/advisories/GHSA-qr6x-7v33-6qmg
github.com/CVEProject/cvelistV5/tree/main/cves/2026/115xxx/CVE-2026-115924.json
github.com/danielgatis/rembg
Left out here: 3 versions. The JSON record has them.