Skip to content

Commit

Permalink
Error when loading multiple YAML documents with safe_load
Browse files Browse the repository at this point in the history
Using "safe_load" throws an exception when multiple documents  
are found in a YAML file, preventing rules with "correlation" from being converted.
  • Loading branch information
jjsilvalins authored Jan 19, 2025
1 parent 28cc56b commit a915506
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def convert():
rule = str(base64.b64decode(request.json["rule"]), "utf-8")
# check if input is valid yaml
try:
yaml.safe_load(rule)
yaml.safe_load_all(rule)
except:
return Response(
f"YamlError: Malformed yaml file", status=400, mimetype="text/html"
Expand Down

0 comments on commit a915506

Please # to comment.