Skip to content

Commit 0096dbe

Browse files
author
Stanley
committed
feat: Added a new rule to detect unsafe use of yaml.load
1 parent fe783ac commit 0096dbe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pyspector/rules/built-in-rules.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ remediation = "Avoid shell=True with subprocess.run. Pass commands as a list ins
8484
ast_match = "Call(func.value.id=subprocess, func.attr=run)"
8585
file_pattern = "*.py"
8686

87+
[[rule]]
88+
id = "PY107"
89+
description = "Unsafe deserialization with 'yaml.load'."
90+
severity = "High"
91+
remediation = "Use 'yaml.safe_load()' instead of 'yaml.load()'."
92+
ast_match = "Call(func.value.id=yaml, func.attr=load)"
93+
file_pattern = "*.py"
94+
8795
# -------------------------------------------
8896
# SECTION: Cryptographic Failures (OWASP A02:2021)
8997
# -------------------------------------------

0 commit comments

Comments
 (0)