You are viewing this page in an unauthorized frame window.
This is a potential security issue, you are being redirected to
https://nvd.nist.gov
An official website of the United States government
Official websites use .gov
A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS
A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
NIST has updated the
NVD program announcement page with additional information regarding
recent concerns and the temporary delays in enrichment efforts.
CVE-2021-32804
Detail
Description
The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the `preservePaths` flag is not set to `true`. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example `/home/user/.bashrc` would turn into `home/user/.bashrc`. This logic was insufficient when file paths contained repeated path roots such as `////home/user/.bashrc`. `node-tar` would only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. `///home/user/.bashrc`) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. Users may work around this vulnerability without upgrading by creating a custom `onentry` method which sanitizes the `entry.path` or a `filter` method which removes entries with absolute paths. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.
NVD Analysts use publicly available information to associate vector strings and CVSS scores. We also display any CVSS information provided within the CVE List from the CNA.
Note: It is possible that the NVD CVSS may not match that of the CNA. The most common reason for this is that publicly available information does not provide sufficient detail or that information simply was not available at the time the CVSS vector string was assigned.
NVD Analysts use publicly available information to associate vector strings and CVSS scores. We also display any CVSS information provided within the CVE List from the CNA.
Note: NVD Analysts have published a CVSS score for this CVE based on publicly available information at the time of analysis. The CNA has not provided a score within the CVE List.
References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving NIST webspace.
We have provided these links to other web sites because they
may have information that would be of interest to you. No
inferences should be drawn on account of other sites being
referenced, or not, from this page. There may be other web
sites that are more appropriate for your purpose. NIST does
not necessarily endorse the views expressed, or concur with
the facts presented on these sites. Further, NIST does not
endorse any commercial products that may be mentioned on
these sites. Please address comments about this page to nvd@nist.gov.
OR
*cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.2.2
*cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions from (including) 4.0.0 up to (excluding) 4.4.14
*cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 5.0.6
*cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions from (including) 6.0.0 up to (excluding) 6.1.1
Added
CVSS V2
NIST (AV:N/AC:M/Au:N/C:N/I:P/A:P)
Added
CVSS V2 Metadata
Victim must voluntarily interact with attack mechanism
Added
CVSS V3.1
NIST AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Added
CWE
NIST CWE-22
Changed
Reference Type
https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4 No Types Assigned
https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4 Patch, Third Party Advisory
Changed
Reference Type
https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9 No Types Assigned
https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9 Mitigation, Third Party Advisory
Changed
Reference Type
https://www.npmjs.com/advisories/1770 No Types Assigned
https://www.npmjs.com/advisories/1770 Mitigation, Third Party Advisory
Changed
Reference Type
https://www.npmjs.com/package/tar No Types Assigned
https://www.npmjs.com/package/tar Product, Third Party Advisory
The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the `preservePaths` flag is not set to `true`. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example `/home/user/.bashrc` would turn into
The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the `preservePaths` flag is not set to `true`. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example `/home/user/.bashrc` would turn into
Quick Info
CVE Dictionary Entry: CVE-2021-32804 NVD
Published Date: 08/03/2021 NVD
Last Modified: 04/25/2022
Source: GitHub, Inc.