-
Notifications
You must be signed in to change notification settings - Fork 5.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(runtime): implement __proto__ getter, ignore and warn on setter #16775
base: main
Are you sure you want to change the base?
Conversation
37c56cf
to
31026f3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
Can you add a test case demonstrating that package like chalk@3
works with this change? Eg. you can add an integration test in npm_tests.rs
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Since the |
Vite with babel is failing on any code change without this PR, so I would love to get it merged soon. |
This closes #16833. |
Does the output contain the full stack trace where the error is coming from? |
This doesn't resolve the usages of chalk in Update: next.js doesn't use chalk in a way that it requires |
Maybe I feel like silently creating/returning It's also possible to emit the warning only once, with a longer explanation on why the error occurred and what the user can do -- perhaps that's a better solution? Something along the lines of
|
(Note that getters and setters will look to |
What about a warning when deno downloads the npm package? |
A lot of npm modules depend on using
__proto__
, either directly or indirectly through and old dependency they're using. This causes silent__proto__
key creations which then lead to completely unrelated errors that take a lot of time to debug.This PR adds a getter for
__proto__
usingObject.getPrototypeOf()
, and warns (while not actually setting the prototype) when trying to set__proto__
, since allowing__proto__
to be set creates security vulnerabilities (as per #4341)Examples of modules broken:
Support Next.JS #16679Next.js will emit a warning because it uses an outdated version of chalk that'll use__proto__
internally, but this does not affect usage of the module__proto__
behaves differently from Chrome, Node, and Firefox #16833