-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: prototype pollution vulnerability in extend (CVE-2024-45435) #1433
base: main
Are you sure you want to change the base?
Conversation
Hi @andersk , Thank you for your feedback regarding the report. I would like to highlight an additional prototype accessor:
Checking for the presence of Best, |
4801823
to
17cffef
Compare
Nope, it’s not. extend({}, {"hasOwnProperty": {"polluted": "yes"}});
console.log(Object.prototype.hasOwnProperty.polluted); // → yes I’ve pushed a more complete fix. |
6745108
to
12b84bd
Compare
Please merge this fix as it's a severity score is high. |
for (const prop in source) { | ||
if (targetProto !== null && prop in targetProto) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose the following change for this line:
if (prop === "__proto__" || prop === "constructor" || (targetProto !== null && prop in targetProto)) {
See: https://codeql.github.com/codeql-query-help/javascript/js-prototype-pollution-utility/
https://nvd.nist.gov/vuln/detail/CVE-2024-45435
https://gist.github.com/tariqhawis/c67177164d3b7975210caddb25b60d62