Closed huntr-helper closed 3 years ago
@jonschlinkert - let me know if you have any questions or thoughts, cheers! š°
This looks pretty straight forward to me. @jonschlinkert Could we merge in this PR?
This is incorrect. This library uses set-value
, which ignores unsafe keys: https://github.com/jonschlinkert/set-value/blob/master/index.js#L102.
https://huntr.dev/users/d3v53c has fixed the Prototype Pollution vulnerability šØ. Think you could fix a vulnerability like this?
Get involved at https://huntr.dev/
Q | A Version Affected | ALL Bug Fix | YES Original Pull Request | https://github.com/418sec/cache-base/pull/1 Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/cache-base/1/README.md
User Comments:
š Metadata *
cache-base is vulnerable to Prototype Pollution.
Bounty URL: https://www.huntr.dev/bounties/1-npm-cache-base
āļø Description *
Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as proto, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain.
š» Technical Description *
Fixed by avoiding setting magical attributes. The bug is fixed by validating the input strArray to check for prototypes. It is implemented by a simple validation to check for prototype keywords (proto, constructor and prototype), where if it exists, the function returns the object without modifying it, thus fixing the Prototype Pollution Vulnerability.
š Proof of Concept (PoC) *
Create the following PoC file:
Execute the following commands in terminal:
Check the Output:
Yes! Its Polluted
š„ Proof of Fix (PoF) *
Before:
After:
š User Acceptance Testing (UAT)
After the fix, functionality is unaffected.
š Relates to...
Provide the URL of the PR for the disclosure that this fix relates to.
https://github.com/418sec/huntr/pull/1498