Security Fix for Arbitrary Code Execution - huntr.dev#16
Open
huntr-helper wants to merge 4 commits intodanijar:masterfrom
Open
Security Fix for Arbitrary Code Execution - huntr.dev#16huntr-helper wants to merge 4 commits intodanijar:masterfrom
huntr-helper wants to merge 4 commits intodanijar:masterfrom
Conversation
Fixed Arbitrary code execution in definitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://huntr.dev/users/d3m0n-r00t has fixed the Arbitrary Code Execution vulnerability 🔨. d3m0n-r00t has been awarded $25 for fixing the vulnerability through the huntr bug bounty program 💵. 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
GitHub Issue | #14
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/pip/definitions/1/README.md
User Comments:
📊 Metadata *
Bounty URL: https://www.huntr.dev/bounties/1-pip-definitions
⚙️ Description *
definitions loads and validates YAML definitions against a schema.
This package is vulnerable to Arbitrary Code Execution via. the load() method in definitions/parser.py. The parser is used to load yaml files using the unsafe
load()method inpyyaml. This lead to code execution. Changed the unsafeload()to safersafe_load()thus eliminating code execution and safe loading of yaml files.💻 Technical Description *
The definitions library can be used to load and validate yaml definitions against a schema. This package was vulnerable to Arbitrary code execution due to a use of a known vulnerable function
load()in pyyaml.The unsafe
load()was changed tosafe_load()in pyyaml which is the fix proposed by the author of pyyaml and instructs to use it in every project.🐛 Proof of Concept (PoC) *
Referece: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
🔥 Proof of Fix (PoF) *
👍 User Acceptance Testing (UAT)
Before the fix the when running vulnerable code we can see a warning not to use the
load()function. After the fix the loading runs smoothly withoutcode executionorwarningsFix referance: https://stackoverflow.com/questions/1773805/how-can-i-parse-a-yaml-file-in-python