6.5medium
node-tar vulnerable to denial of service while parsing a tar file due to lack of folders count validation
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.93% (higher than 61% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-f5x3-32g6-xq36
Description
node-tar is a Tar for Node.js. node-tar prior to version 6.2.1 has no limit on the number of sub-folders created in the folder creation process. An attacker who generates a large number of sub-folders can consume memory on the system running node-tar and even crash the Node.js client within few seconds of running it using a path with too many sub-folders inside. Version 6.2.1 fixes this issue by preventing extraction in excessively deep sub-folders.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| isaacs node-tar | < 6.2.1 | CVE List |
| node-tar_project node-tar | before 6.2.1 | CVE List |
| node-tar (npm) | before 6.2.1 | GitHub Advisory Database |
| tar (npm) | before 6.2.1 | GitHub Advisory Database |
| isaacs tar | before 6.2.1 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
node-tar is a Tar for Node.js. node-tar prior to version 6.2.1 has no limit on the number of sub-folders created in the folder creation process. An attacker who generates a large number of sub-folders can consume memory on the system running node-tar and even crash the Node.js client within few seconds of running it using a path with too many sub-folders inside. Version 6.2.1 fixes this issue by preventing extraction in excessively deep sub-folders.
GitHub Advisory Database
Description:
During some analysis today on npm's node-tar package I came across the folder creation process, Basicly if you provide node-tar with a path like this ./a/b/c/foo.txt it would create every folder and sub-folder here a, b and c until it reaches the last folder to create foo.txt, In-this case I noticed that there's no validation at all on the amount of folders being created, that said we're actually able to CPU and memory consume the system running node-tar and even crash the nodejs client within few seconds of running it using a path with too many sub-folders inside
Steps To Reproduce:
You can reproduce this issue by downloading the tar file I provided in the resources and using node-tar to extract it, you should get the same behavior as the video
Proof Of Concept:
Here's a video show-casing the exploit:
Impact
Denial of service by crashing the nodejs client when attempting to parse a tar archive, make it run out of heap memory and consuming server CPU and memory resources
Report resources
Note
This report was originally reported to GitHub bug bounty program, they asked me to report it to you a month ago
NVD (es)
node-tar es un Tar para Node.js. Node-tar anterior a la versión 6.2.1 no tiene límite en la cantidad de subcarpetas creadas en el proceso de creación de carpetas. Un atacante que genera una gran cantidad de subcarpetas puede consumir memoria en el sistema que ejecuta node-tar e incluso bloquear el cliente Node.js a los pocos segundos de ejecutarlo usando una ruta con demasiadas subcarpetas dentro. La versión 6.2.1 soluciona este problema impidiendo la extracción en subcarpetas excesivamente profundas.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-28863 changed 2025-02-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-f5x3-32g6-xq36 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-28863 changed 2026-06-17 | Public domain |