CVE-2021-23518: Prototype Pollution
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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/node-cached-path-relativeto a version that resolves this vulnerability.Fixed in 1.0.1-1ubuntu0.1~esm1 - Upgrade
Upgrade
ubuntu/node-cached-path-relativeto a version that resolves this vulnerability.Fixed in 1.0.2-1ubuntu0.1~esm1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.1.0
Event History
Frequently Asked Questions
Which deployments are affected?
Deployments using cached-path-relative versions earlier than 1.1.0 are affected. The listed software contexts include Node.js and Debian Linux.
What input is required to trigger the issue?
An attacker needs the origin path supplied to the cachedPathRelative function to be __proto__. This causes the cache object to access a prototype attribute instead of treating the value as a path.
What change addresses the vulnerability?
Upgrade cached-path-relative to version 1.1.0 or later. The underlying issue is the cache being initialized as {} rather than Object.create(null), allowing access to parent prototype properties.