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.sammodel through rembg/commands/scommand.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 sammodel 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rembgto a version that resolves this vulnerability.Fixed in 2.0.82
Event History
Frequently Asked Questions
Who is exposed to this issue?
Instances that expose Rembg's public /api/remove endpoint and run a version prior to 2.0.82 are exposed. Exploitation can disclose files that are readable by the rembg process.
Does exploitation require authentication or user interaction?
No. The affected endpoint is public, and the stated attack vector requires neither privileges nor user interaction.
What does an attacker need to provide?
The attacker supplies a crafted extras.sam_model value that combines path traversal with URL fragment syntax. The attack uses an initial request to prime the selected path tree and an identical repeated request to download malicious ONNX encoder and decoder files.
What is the impact beyond file disclosure?
Malicious ONNX graphs can load a readable target file through ONNX external data and encode its contents into the returned PNG mask, allowing complete file disclosure. The description also states that the graphs permit arbitrary ONNX computation.
What version fixes the issue?
Upgrade Rembg to version 2.0.82, which fixes this issue.