Skip to content

Fixes #1854, prototype pollution#1856

Merged
jrburke merged 1 commit intomasterfrom
jr/1854-pollution
Jul 20, 2024
Merged

Fixes #1854, prototype pollution#1856
jrburke merged 1 commit intomasterfrom
jr/1854-pollution

Conversation

@jrburke
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@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