CVE-2021-23518: Prototype Pollution

Published Jan 21, 2022
·
Updated

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

9 affected componentsFixes available
Cached-path-relative Project Cached-path-relative Node.js<1.1.0
Debian Debian Linux=10.0
ubuntu/node-cached-path-relative<1.0.1-1ubuntu0.1~esm1
1.0.1-1ubuntu0.1~esm1
ubuntu/node-cached-path-relative<1.0.2-1ubuntu0.1~esm1
1.0.2-1ubuntu0.1~esm1
ubuntu/node-cached-path-relative*
ubuntu/node-cached-path-relative*
ubuntu/node-cached-path-relative*
ubuntu/node-cached-path-relative*
ubuntu/node-cached-path-relative*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/node-cached-path-relative to a version that resolves this vulnerability.

    Fixed in 1.0.1-1ubuntu0.1~esm1
  2. Upgrade

    Upgrade ubuntu/node-cached-path-relative to a version that resolves this vulnerability.

    Fixed in 1.0.2-1ubuntu0.1~esm1
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.1.0

Event History

Jan 21, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
CVE Published
via MITRE·08:05 PM
Data Sourced
via OSV·08:15 PM
DescriptionSeverityAffected Software
Data Sourced
08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

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.

2

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.

3

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203