Read the docs

Rembg path traversal via SAM model parameter exposes local files

Priority HIGH 76CWE-22Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
High · Low · Low
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.

Summary

Rembg before 2.0.82 has a path traversal flaw (CWE-22) in how the public /api/remove endpoint handles the sam_model parameter. The value is used in local file paths and download URLs without a pinned hash check. An unauthenticated remote attacker can use crafted model names to make the server load malicious ONNX models that expose complete files readable by the rembg process, encoded into the returned PNG mask, and can run arbitrary ONNX computation.

Written with Claude Haiku 5.5 from the sources below · 2026-10-31

Description from the CNA

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00394 33rd percentileScored 2026-11-07
Fix Fixed rembg (danielgatis): 2.0.82rembg (PyPI): 2.0.82

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
danielgatisrembgbefore 2.0.822.0.82Patch availableCNA
—rembg (PyPI)before 2.0.822.0.82Patch availableGHSA-qr6x-7v33-6qmg
  • rembg Vendordanielgatis Affected before 2.0.82 Fixed in 2.0.82 Patch available CNA
  • rembg (PyPI) Vendor— Affected before 2.0.82 Fixed in 2.0.82 Patch available GHSA-qr6x-7v33-6qmg

CPE names Threatist (inferred) · 1

Inferred from how NVD named this product before; not given by a source.

CPEVersionsRoleVendor
cpe:2.3:a:danielgatis:rembg:*:*:*:*:*:*:*:*——danielgatis
  • cpe:2.3:a:danielgatis:rembg:*:*:*:*:*:*:*:* Versions — — ·danielgatis

Remediation

Update the PyPI package rembg to version 2.0.82, which fixes this issue.

Written with Claude Haiku 5.5 from the sources below · 2026-10-31

  • Fix · CNA rembg (danielgatis) Fixed in 2.0.82
  • Fix · GHSA-qr6x-7v33-6qmg rembg (PyPI) Fixed in 2.0.82 Advisory →

Timeline

  1. 2026-10-26 Threatist record created from CVE-2026-115924
  2. 2026-10-27 Alias added: GHSA-qr6x-7v33-6qmg
  3. 2026-10-27 Priority changed: MEDIUM → LOW
  4. 2026-10-31 CISA SSVC decision points changed
  5. 2026-10-31 Priority changed: LOW → HIGH

References

  • TI-2026-28914 Rembg has a Path Traversal via Custom Model Loading CVSS 3.1MEDIUM 5.3
  • TI-2025-18956 Rembg CORS misconfiguration CVSS 4.0HIGH 8.7
  • TI-2025-18955 Rembg allows SSRF via /api/remove CVSS 4.0MEDIUM 6.9

Sources