Skip to main content

Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

CVE-2021-23518

Severity High
Score 9.8/10

Summary

The package cached-path-relative versions prior to 1.1.0 are vulnerable to Prototype Pollution via the "cache" variable, which is initialized as "{}" instead of "Object.create(null)" in the "cachedPathRelative" function. This allows access to parent prototype properties when the object is used to create the cached relative path. When using the origin path as "__proto__", the prototype attribute of the object is accessed instead of a file path.

  • LOW
  • NETWORK
  • HIGH
  • UNCHANGED
  • NONE
  • NONE
  • HIGH
  • HIGH

CWE-1321 - Prototype Pollution

Prototype pollution is one of the lesser-known vulnerabilities. It allows attackers to abuse the rules of JavaScript by injecting properties into the general object “Object” in JS. Modifying the prototype of “Object” affects the behavior of all objects in the entire app, potentially resulting in denial of service, arbitrary code execution, cross-site scripting, etc.

References

Advisory Timeline

  • Published