Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. cached-path-relative
  4. ›
  5. CVE-2021-23518

CVE-2021-23518: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

January 21, 2022 (updated February 3, 2023)

The package cached-path-relative is 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

References

  • github.com/ashaffer/cached-path-relative/commit/40c73bf70c58add5aec7d11e4f36b93d144bb760
  • nvd.nist.gov/vuln/detail/CVE-2021-23518
  • snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2348246
  • snyk.io/vuln/SNYK-JS-CACHEDPATHRELATIVE-2342653

Code Behaviors & Features

Detect and mitigate CVE-2021-23518 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.1.0

Fixed versions

  • 1.1.0

Solution

Upgrade to version 1.1.0 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

Source file

npm/cached-path-relative/CVE-2021-23518.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:16 +0000.