Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype Pollution Affecting property-expr@1.5.0 #2220

Open
syukronarie opened this issue May 29, 2024 · 0 comments
Open

Prototype Pollution Affecting property-expr@1.5.0 #2220

syukronarie opened this issue May 29, 2024 · 0 comments

Comments

@syukronarie
Copy link

Describe the bug
Prototype Pollution
Affecting property-expr package, versions <2.0.3

property-expr is a tiny util for getting and setting deep object props safely

Affected versions of this package are vulnerable to Prototype Pollution via the setter function.

POC

var expr = require('property-expr');
expr.setter('__proto__.polluted')({}, true);
console.log(polluted); // true

Details:
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge
  • Property definition by path

How to fix?
Upgrade property-expr to version 2.0.3 or higher.

Reference:
https://security.snyk.io/vuln/SNYK-JS-PROPERTYEXPR-598800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant