CVE-2025-54387
JavaScript vulnerability analysis and mitigation

Overview

IPX, an image optimizer powered by sharp and svgo, has been identified with a path traversal vulnerability (CVE-2025-54387) discovered on August 4, 2025. The vulnerability affects versions 1.3.1 and below, 2.0.0-0 through 2.1.0, and 3.0.0 through 3.1.0. The issue stems from improper path validation when checking whether a path is within allowed directories, particularly when the allowed directories do not end with a path separator (GitHub Advisory).

Technical details

The vulnerability occurs due to the approach used to check whether a path is within allowed directories, which relies on a raw string prefix comparison. When the allowed directories do not end with a path separator, the check can be bypassed. This creates a path traversal vulnerability that could allow access to files outside the intended directory structure. The vulnerability has been assigned a CVSS v4.0 score of 6.9 (Medium) with the vector string 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 (GitHub Advisory).

Impact

The vulnerability could allow attackers to access files outside the intended directory structure through path traversal. For example, if a directory is set to './public', an attacker could potentially access files in '../public123/test.png' due to the prefix matching bypass. This could lead to unauthorized access to sensitive files outside the restricted directory (GitHub Advisory).

Exploitability

The vulnerability can be exploited remotely without requiring special privileges or user interaction. A proof of concept has been provided demonstrating how an attacker could bypass the directory restrictions by manipulating the path prefix. The attack requires crafting specific paths that share a common prefix with the allowed directory (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in versions 1.3.2, 2.1.1, and 3.1.1. The fix involves ensuring that directory paths end with a path separator before performing the prefix comparison check. Users are strongly recommended to upgrade to these patched versions: >= v1.3.2 < 2.0.0 || >= v2.1.1 < 3.0.0 || >= v3.1.1 (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-48170CRITICAL9.1
  • JavaScript logoJavaScript
  • scim-patch
NoYesAug 07, 2026
CVE-2026-48007HIGH8.6
  • JavaScript logoJavaScript
  • @element-hq/element-call-embedded
NoYesAug 07, 2026
CVE-2026-69207MEDIUM5.3
  • JavaScript logoJavaScript
  • gemini-cli
NoYesAug 07, 2026
CVE-2026-71850MEDIUM4.8
  • JavaScript logoJavaScript
  • hono
NoYesAug 07, 2026
CVE-2026-71849LOW3.7
  • JavaScript logoJavaScript
  • hono
NoYesAug 07, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management