Skip to content

Fixes #1854, prototype pollution #1856

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

Merged
merged 1 commit into from
Jul 20, 2024
Merged

Fixes #1854, prototype pollution #1856

merged 1 commit into from
Jul 20, 2024

Conversation

jrburke
Copy link
Member

@jrburke jrburke commented Jul 16, 2024

Hopefully fixes #1854. I'll put up a branch/PR in r.js in a moment so people can try it in node too.

@jrburke
Copy link
Member Author

jrburke commented Jul 16, 2024

See the r.js equivalent of this PR here, if you want to try the fix in node:
requirejs/r.js#1016

@jrburke
Copy link
Member Author

jrburke commented Jul 16, 2024

Some notes on this change:

I wanted the minimally invasive change, since this code is old, and it has been advertised on working in very old JS versions. So using Object.freeze, Map, or Object.create(null) are all newer JS idioms than what this code was originally designed for.

Copy link

@ashfurrow ashfurrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is older code and I am honestly not too familiar with it. However, I know a large community of people are looking for this to get fixed and I want to help, so I took a look.

This change makes sense to me. It's minimal enough to not break too many existing codebases but still addresses the prototype pollution vulnerability. I've read through the require.js file to get a sense of what it's doing and why.

Thanks for your work here after this came out of the blue. I appreciate your contributions, past and present.

@jrburke jrburke merged commit 6e8a234 into master Jul 20, 2024
@jrburke jrburke deleted the jr/1854-pollution branch July 20, 2024 21:42
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

Successfully merging this pull request may close these issues.

Security Vulnerability: Prototype polution
2 participants