CVE-2024-56198 path-sanitizer allows bypassing the existing filters to achieve path-traversal vulnerability

Critical 9.3 Published Updated

Attackers can bypass path sanitization filters to access or modify arbitrary files on the system.

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

What is CVE-2024-56198?

CVE-2024-56198 is a critical path traversal vulnerability in cabraviva path-sanitizer, published on 31 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

path-sanitizer is a simple lightweight npm package for sanitizing paths to prevent Path Traversal. Prior to 3.1.0, the filters can be bypassed using .=%5c which results in a path traversal. This vulnerability is fixed in 3.1.0.

Weakness: CWE-22

Which versions are affected by CVE-2024-56198?

2 open source packages ship an affected version, including path-sanitizer.

PackageAffectedFixed in
path-sanitizer npmAll versions3.1.0
path-sanitizer npmAll versions3.1.0

How do I fix CVE-2024-56198?

Upgrade path-sanitizer to 3.1.0 or later.

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

Is CVE-2024-56198 being exploited?

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

Sources

Also known as GHSA-94p5-r7cc-3rpr.

Is CVE-2024-56198 in your software?

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

Check your SBOMs for free