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

Fix prototype pollution #37

Merged
merged 2 commits into from
Dec 10, 2020
Merged

Fix prototype pollution #37

merged 2 commits into from
Dec 10, 2020

Conversation

evangelion1204
Copy link
Owner

@evangelion1204 evangelion1204 commented Dec 10, 2020

Fixed prototype pollution by ignoring __proto__ in sections and keys.

Steps to reproduce
payload.ini

[__proto__]
polluted = "polluted"

poc.js:

var ini = require('multi-ini')

var parsed = ini.read('./payload.toml', { encoding: 'utf8' })
console.log(parsed)
console.log(parsed.__proto__)
console.log({}.__proto__)
console.log(polluted)
> node poc.js
{}
{ polluted: 'polluted' }
{ polluted: 'polluted' }
polluted

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 95.111% when pulling 4617804 on fix-prototype-pollution into f494134 on master.

@evangelion1204 evangelion1204 merged commit 49d6027 into master Dec 10, 2020
@evangelion1204 evangelion1204 deleted the fix-prototype-pollution branch December 10, 2020 20:51
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.

None yet

2 participants