Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Allocation of Resources Without Limits or Throttling vulnerabilities in an interactive lesson.
Start learningUpgrade tar to version 8.0.2 or higher.
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the path-reservation bookkeeping code (src/path-reservations.ts and src/unpack.ts). The getDirs function computes every ancestor prefix of each reserved path, and its cost is quadratic in the length of linkpath, which has no depth or length bound and is reserved for every entry type. An attacker can supply an archive of a few hundred bytes compressed to exhaust CPU and crash the Node process (VULN-002), or use very long path components within the maxDepth limit to exhaust memory (VULN-023). Additionally, PathReservations.#reservations entries are never released during extraction, the normalizeUnicode cache is bounded by entry count rather than bytes, and filesFilter memoises every path prefix, all of which cause unbounded memory growth during large or long-running extractions.
`exploit_tests/test_vuln_002_*`, `_023_`, `_009_`, `_012_` and `_024_`. Each test runs a control archive and an attack archive against the unmodified 7.5.22 build, with output recorded in `exploit_tests/evidence/`. All were run on macOS.
Note: Tests were run on macOS against the unmodified 7.5.22 build.