Vulnerability · Published Jan 21, 2022 · Assigned by snyk
CVE-2021-23518Prototype Pollution
High 7.3
In plain English
A high-severity security flaw in cached-path-relative. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 80% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
The package cached-path-relative before 1.1.0 are vulnerable to Prototype Pollution via the cache variable that is set as {} instead of Object.create(null) in the cachedPathRelative function, which allows access to the parent prototype properties when the object is used to create the cached relative path. When using the origin path as __proto__, the attribute of the object is accessed instead of a path. **Note:** This vulnerability derives from an incomplete fix in https://security.snyk.io/vuln/SNYK-JS-CACHEDPATHRELATIVE-72573
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-cached-path-relative | 1.1.0+~1.0.0-1 | DEBIAN-CVE-2021-23518 |
| Debian:13 | node-cached-path-relative | 1.1.0+~1.0.0-1 | DEBIAN-CVE-2021-23518 |
| Debian:14 | node-cached-path-relative | 1.1.0+~1.0.0-1 | DEBIAN-CVE-2021-23518 |
| Ubuntu:22.04:LTS | node-cached-path-relative | no fix listed | UBUNTU-CVE-2021-23518 |
| Ubuntu:24.04:LTS | node-cached-path-relative | no fix listed | UBUNTU-CVE-2021-23518 |
| Ubuntu:25.10 | node-cached-path-relative | no fix listed | UBUNTU-CVE-2021-23518 |
| Ubuntu:26.04:LTS | node-cached-path-relative | no fix listed | UBUNTU-CVE-2021-23518 |
| Ubuntu:26.10 | node-cached-path-relative | no fix listed | UBUNTU-CVE-2021-23518 |
| npm | cached-path-relative | 1.1.0 | GHSA-wg6g-ppvx-927h |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | cached-path-relative | unspecified – before 1.1.0 |
References
- https://snyk.io/vuln/SNYK-JS-CACHEDPATHRELATIVE-2342653
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2348246
- https://github.com/ashaffer/cached-path-relative/commit/40c73bf70c58add5aec7d11e4f36b93d144bb760
- [debian-lts-announce] 20221204 [SECURITY] [DLA 3221-1] node-cached-path-relative security update mailing-list