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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Fix for Prototype Pollution - huntr.dev #27

Merged
merged 3 commits into from
Jan 22, 2021

Conversation

huntr-helper
Copy link

https://huntr.dev/users/arjunshibu 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 | 418sec#1
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/xe-utils/1/README.md

User Comments:

馃搳 Metadata *

xe-utils is vulnerable to Prototype Pollution.

Bounty URL: https://www.huntr.dev/bounties/1-npm-xe-utils

鈿欙笍 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 *

Fix implemented by not allowing to modify object prototype.

馃悰 Proof of Concept (PoC) *

  1. Create the following PoC file:
// poc.js
const { set } = require('xe-utils')
console.log(`Before: ${{}.polluted}`)
set({}, '__proto__.polluted', true)
console.log(`After: ${{}.polluted}`)
  1. Execute the following commands in terminal:
npm i xe-utils # Install affected module
node poc.js #  Run the PoC
  1. Check the Output:
Before: undefined
After: true

馃敟 Proof of Fix (PoF) *

image

+1 User Acceptance Testing (UAT)

  • I've executed unit tests.
  • After fix the functionality is unaffected.

@xuliangzhan
Copy link
Collaborator

That's a question. Thank.

@xuliangzhan xuliangzhan merged commit fa9930b into x-extends:master Jan 22, 2021
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

4 participants