CVE-2026-40086 Rembg has a Path Traversal via Custom Model Loading

Medium 5.3 Published Updated

Unauthenticated attackers can read arbitrary files from the server filesystem via a crafted model_path parameter in the Rembg HTTP server.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-40086?

CVE-2026-40086 is a medium-severity path traversal vulnerability in danielgatis rembg, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Rembg is a tool to remove images background. Prior to 2.0.75, a path traversal vulnerability in the rembg HTTP server allows unauthenticated remote attackers to read arbitrary files from the server's filesystem. By sending a crafted request with a malicious model_path parameter, an attacker can force the server to attempt loading any file as an ONNX model, revealing file existence, permissions, and potentially file contents through error messages. This vulnerability is fixed in 2.0.75.

Weakness: CWE-73, CWE-22

Which versions are affected by CVE-2026-40086?

3 open source packages ship an affected version, including rembg. It affects 1 product.

PackageAffectedFixed in
rembg PyPIAll versions2.0.75
rembg PyPIAll versions2.0.75
rembg PyPIAll versions2.0.75

Products include Danielgatis Rembg.

How do I fix CVE-2026-40086?

Upgrade rembg to 2.0.75 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-40086 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40086 exists.

Sources

Also known as GHSA-3wqj-33cg-xc48, PYSEC-2026-2274.

Is CVE-2026-40086 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free