-
Notifications
You must be signed in to change notification settings - Fork 621
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
Replaces unsafe yaml loaders with yaml.safe_load #3753
Conversation
@@ -1014,11 +1014,7 @@ def image_from_docker_args(args: List[str]) -> Optional[str]: | |||
|
|||
|
|||
def load_yaml(file: Any) -> Any: | |||
"""If pyyaml > 5.1 use full_load to avoid warning""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: what warning was this? And do we actually use the functionality of full_load?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must have been a deprecation warning like shown here yaml/pyyaml#265
Codecov Report
@@ Coverage Diff @@
## master #3753 +/- ##
==========================================
+ Coverage 81.83% 81.84% +0.01%
==========================================
Files 241 241
Lines 29771 29769 -2
==========================================
+ Hits 24362 24364 +2
+ Misses 5409 5405 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -1014,11 +1014,7 @@ def image_from_docker_args(args: List[str]) -> Optional[str]: | |||
|
|||
|
|||
def load_yaml(file: Any) -> Any: | |||
"""If pyyaml > 5.1 use full_load to avoid warning""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must have been a deprecation warning like shown here yaml/pyyaml#265
Fixes WB-9909
Description
What does the PR do?
FullLoader and Loader should not be used on untrusted data. While it can be argued that the config file can be "trusted" data, this PR replaces unsafe yaml.full_load and yaml.load with yaml.safe_load to eliminate the possibility of a malicious config file being run causing arbitrary code execution.
Testing
How was this PR tested?
make test
Checklist