Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1mNXgzLTMyZzYteHEzNs4AA6O0
Denial of service while parsing a tar file due to lack of folders count validation
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
Permalink: https://github.com/advisories/GHSA-f5x3-32g6-xq36JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1mNXgzLTMyZzYteHEzNs4AA6O0
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 8 months ago
Updated: 6 months ago
CVSS Score: 6.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Identifiers: GHSA-f5x3-32g6-xq36, CVE-2024-28863
References:
- https://github.com/isaacs/node-tar/security/advisories/GHSA-f5x3-32g6-xq36
- https://nvd.nist.gov/vuln/detail/CVE-2024-28863
- https://github.com/isaacs/node-tar/commit/fe8cd57da5686f8695415414bda49206a545f7f7
- https://security.netapp.com/advisory/ntap-20240524-0005
- https://github.com/advisories/GHSA-f5x3-32g6-xq36
Blast Radius: 42.3
Affected Packages
npm:tar
Dependent packages: 5,040Dependent repositories: 3,179,743
Downloads: 125,987,664 last month
Affected Version Ranges: < 6.2.1
Fixed in: 6.2.1
All affected versions: 0.0.1, 0.1.0, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.1.16, 0.1.17, 0.1.18, 0.1.19, 0.1.20, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.2.0, 2.2.1, 2.2.2, 3.0.0, 3.0.1, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2, 4.2.0, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.4.4, 4.4.5, 4.4.6, 4.4.7, 4.4.8, 4.4.9, 4.4.10, 4.4.11, 4.4.12, 4.4.13, 4.4.14, 4.4.15, 4.4.16, 4.4.17, 4.4.18, 4.4.19, 5.0.0, 5.0.1, 5.0.2, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.10, 5.0.11, 6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.1.12, 6.1.13, 6.1.14, 6.1.15, 6.2.0
All unaffected versions: 6.2.1, 7.0.0, 7.0.1, 7.1.0, 7.2.0, 7.3.0, 7.4.0, 7.4.1, 7.4.2, 7.4.3
npm:node-tar
Dependent packages: 6Dependent repositories: 1
Downloads: 2,311 last month
Affected Version Ranges: < 6.2.1
Fixed in: 6.2.1
All affected versions: 1.0.0
All unaffected versions: