Security Fix for Arbitrary Code Injection - huntr.dev #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@ready-research (https://huntr.dev/users/ready-research) has fixed a potential Arbitrary Code Injection vulnerability in your repository 🔨. For more information, visit our website (https://huntr.dev/) or click the bounty URL below...
Q | A
Version Affected | <=10.0.0
Bug Fix | YES
Original Pull Request | 418sec#1
If you are happy with this disclosure, we would love to get a CVE assigned to the vulnerability. Feel free to credit @ready-research, the discloser found in the bounty URL (below) and @huntr-helper.
User Comments:
Replace eval with JSON.parse
📊 Metadata *
json is a 'json' command tool for massaging and processing JSON on the command line.
Affected versions of this package are vulnerable to Arbitrary Code Injection via the -d argument.
Bounty URL: https://www.huntr.dev/bounties/1-npm-json/
⚙️ Description *
Describe your fix clearly and concisely - imagine you are describing it to a non-technical friend.
💻 Technical Description *
Replace eval with JSON.parse to avoid Code injection through the use of eval.
🐛 Proof of Concept (PoC) *
🔥 Proof of Fix (PoF) *
👍 User Acceptance Testing (UAT)
After the fix functionality is not affected.