-
Notifications
You must be signed in to change notification settings - Fork 253
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
Preventing prototype pollution vulnerabilities #2115
Preventing prototype pollution vulnerabilities #2115
Conversation
was the vulnerability just for the clear method? should we add it to the |
Yes, it was only for |
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.
Approved with a couple of minor suggestions 👍🏻
CHANGELOG.md
Outdated
- (metadata-delegate) Preventing prototype pollution vulnerabilities [#2115](https://github.com/bugsnag/bugsnag-js/pull/2115) | ||
|
||
- (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) |
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.
Just a bit of formatting:
- (metadata-delegate) Preventing prototype pollution vulnerabilities [#2115](https://github.com/bugsnag/bugsnag-js/pull/2115) | |
- (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) | |
- (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) | |
- (metadata-delegate) Preventing prototype pollution vulnerabilities [#2115](https://github.com/bugsnag/bugsnag-js/pull/2115) |
key: 'prototype', | ||
expected: {} | ||
} | ||
])('should not add constructor or prototype keys', ({ key, expected }) => { |
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.
You can use $key here (or any key in objects provided to .each
) to output the following at runtime:
should not add constructor keys
should not add prototype keys
])('should not add constructor or prototype keys', ({ key, expected }) => { | |
])('should not add $key keys', ({ key, expected }) => { |
} | ||
} | ||
} | ||
])('should not overwrite constructor or prototype keys', ({ key, state, expected }) => { |
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.
])('should not overwrite constructor or prototype keys', ({ key, state, expected }) => { | |
])('should not overwrite $key keys', ({ key, state, expected }) => { |
Goal
Preventing the
__proto__
,constructor
orprototype
property from being used as a section inclear
andadd
methods of metadata-delegate.jsChangeset
Added condition if
__proto__ || constructor || prototype
tries to pass as a section in theclear
oradd
method, it will not be executed.Testing
Created unit tests for checking 'constructor' and 'prototype'.
it doesn't seem easy to check whether proto keys can be overwritten