org.webjars.npm:cached-path-relative@1.0.1 vulnerabilities

  • latest version

    1.0.2

  • first published

    6 years ago

  • latest version published

    5 years ago

  • licenses detected

  • package manager

Direct Vulnerabilities

Known vulnerabilities in the org.webjars.npm:cached-path-relative package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Prototype Pollution

org.webjars.npm:cached-path-relative is a memoize the results of the path.relative function.

Affected versions of this package 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

###PoC

let cpr = require("cached-path-relative");
process.chdir("tst");
cpr("__proto__", "polluted")
console.log({}.polluted);

//output: ../polluted

How to fix Prototype Pollution?

There is no fixed version for org.webjars.npm:cached-path-relative.

[0,)
  • H
Prototype Pollution

org.webjars.npm:cached-path-relative is a memoize the results of the path.relative function.

Affected versions of this package are vulnerable to Prototype Pollution. An attacker could inject properties on Object.prototype which are then inherited by all the JS objects through the prototype chain.

How to fix Prototype Pollution?

Upgrade org.webjars.npm:cached-path-relative to version 1.0.2 or higher.

[,1.0.2)