-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.securityIssues and PRs related to security.Issues and PRs related to security.
Description
- Version: any
- Platform: any
- Subsystem:
THE PROPOSAL:
- Add Node.js CLI option to control freezing of
Object.prototypeon startup - As possible, emit a deprecation warning whenever
Object.prototypeis modified. - Over time (e.g. Node.js v11+), enable freezing of
Object.prototypeby default.
JUSTIFICATION:
The issue formalizes proposal/discussion started here: https://www.reddit.com/r/node/comments/7y341t/quick_cve20183721_proto_from_jsonparse_mitigation/
- It's a known poor practice to modify
Object.prototypein production code. - There are known vulnerabilities related to overriding of
__proto__properties under some conditions.- There are also plenty of closed Node.js issues one or another way related to the problem.
- Packages which override
toString(),valueOf()or other standard names require just minor modifications.- e.g. use of
Object.defineProperty(), assigning a new object to class.prototypewith the key already defined or other variation.
- e.g. use of
- There are known popular libraries like
should.jswhich will break:- users can fallback to old behavior through the command line option described above
- users can migrate to expect/assert or other assertion interface
- As Node.js has already seen Promise-related enforcements, why not to do that for
Object.prototypeas well?
mixturvdeturckheim
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.securityIssues and PRs related to security.Issues and PRs related to security.