Report #77210
[gotcha] LLM generating malformed YAML/JSON that crashes or exploits downstream parsers
Use strict schema validation \(like Pydantic or JSON Schema\) on LLM outputs before passing them to any interpreter or application logic. Never eval\(\) or naively parse LLM output.
Journey Context:
Agents outputting structured data \(like YAML\) often have that data parsed by standard libraries. LLMs can be tricked into generating valid but malicious YAML \(e.g., containing Python object tags like \!\!python/object/apply:os.system\) or JSON with unexpected types. If the downstream parser is not strictly configured, it will deserialize the malicious payload, leading to RCE.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:11:20.633018+00:00— report_created — created