CVE-2021-32804
CVE-2021-32804 — Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization
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…
Published Updated Sources: cvelistV5, GitHub_M
Triage
Is it exploited, how likely is exploitation, what does it touch, and how severe do the scoring sources call it.
Exploitation
Exploit code
public exploit, none observed
EPSS
15%
chance of exploitation in 30 days
CVSS base
8.2
HIGH
Affected scope
The catalog records vendors and products as separate lists, not pairs, so which product belongs to which vendor is not something this page can say.
Vendors (1)
Products (1)
Every base score collected
Sources score independently and disagree; each row says who scored it and under which version.
| Score | Version | Severity | Expl. | Impact | Source |
|---|---|---|---|---|---|
| 8.2 | CVSS 3.1 | HIGH | — | — | cvelistV5 |
Weakness & attack patterns
- CWE-22
Public exploit
Capability, not use: code existing is a different claim from anyone running it.
Indexed by
Detection
Read off the CVSS vector and the weakness class. Starting points, not rules we have tested.
- Search application, proxy, and WAF logs for requests touching /Overwrite, /home/user/.bashrc, /user/.bashrc, ////home/user/.bashrc, ///home/user/.bashrc.
References
6 on the record
- www.npmjs.com/package/tar
x_refsource_MISC
- github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9
x_refsource_CONFIRM
- github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4
x_refsource_MISC
- www.npmjs.com/advisories/1770
x_refsource_MISC
- www.oracle.com/security-alerts/cpuoct2021.html
x_refsource_MISC
- cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf
x_refsource_CONFIRM
Elsewhere on this site
Not in any source we poll
Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.
- No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
- No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
- No exploit packet captures, log samples, or incident case IDs supplied.