All vulnerabilities

PyPI

CVE-2026-115924

Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs

Severity
High 8.6
Published
27 Oct 2026
Last changed
27 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
2.0.82
Exploit chance
0.6% in the next 30 daysHigher than 47% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Path traversal (CWE-22)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data · Change some data · Slow it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L
Also known as
GHSA-qr6x-7v33-6qmg
Sources
OSV.dev and GitHub

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.

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
rembgPyPI · osv:PyPI:rembg
  • Every version before 2.0.82

About rembg

Weekly downloads (PyPI)
1,277,026PyPI Stats, 23 Nov 2026

This is the only vulnerability in rembg in our list.

References