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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add another bad example of yaml load #905

Merged
merged 1 commit into from May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/yaml_load.py
Expand Up @@ -16,3 +16,5 @@ def test_yaml_load():
def test_json_load():
# no issue should be found
j = json.load("{}")

yaml.load("{}", Loader=yaml.Loader)
4 changes: 2 additions & 2 deletions tests/functional/test_functional.py
Expand Up @@ -492,8 +492,8 @@ def test_django_sql_injection_raw(self):
def test_yaml(self):
"""Test for `yaml.load`."""
expect = {
"SEVERITY": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 1, "HIGH": 0},
"CONFIDENCE": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 1},
"SEVERITY": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 2, "HIGH": 0},
"CONFIDENCE": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 2},
}
self.check_example("yaml_load.py", expect)

Expand Down