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

New rule: Disallow use of Object.prototypes builtins directly (no-prototype-builtins) #1310

Closed
feross opened this issue Jul 5, 2019 · 1 comment

Comments

@feross
Copy link
Member

feross commented Jul 5, 2019

https://eslint.org/docs/rules/no-prototype-builtins

This is an important rule which has security and DDoS implications. It's also part of the ESLint recommended set. I plan to ship it standard 13.

@feross feross added this to the standard v13 milestone Jul 5, 2019
@feross feross added the accepted label Jul 5, 2019
@feross
Copy link
Member Author

feross commented Jul 5, 2019

3% failure rate in the ecosystem. This is a bit high and most of these seem to not be actually crash risks, but on the other hand, I have forgotten that this is a possible issue before and would rather just be reminded to always use Object.prototype.hasOwnProperty.call(obj, 'key') than to risk forgetting to do so when it really counts.

Also, one doesn't use hasOwnProperty that often anyway, so this shouldn't add too much verbosity.

@feross feross closed this as completed Jul 6, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

1 participant