Rembg: Unauthenticated SAM model injection permits local-file disclosure through malicious ONNX graphs
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 2.0.82
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
Rembg, an open-source tool for removing image backgrounds, is affected, specifically its public API endpoint used for SAM model handling. An unauthenticated attacker can exploit this to read arbitrary files accessible to the Rembg process and run arbitrary computations through malicious model files.
Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.
Read the original description
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.
Timeline
- CVE published
- First seen by cve.now
Affected versions
- danielgatis rembg
fixed in 2.0.82
- rembgPyPI
fixed in 2.0.82