Report #54244
[gotcha] LLM outputs malicious JSON that breaks application logic
Strictly validate and parse LLM JSON outputs; never use eval\(\) or naive string replacement. Use a schema validator.
Journey Context:
Developers often ask LLMs to output JSON and then parse it naively. An attacker can inject a prompt that causes the LLM to output malformed JSON or JSON with unexpected keys/values that exploit vulnerabilities in the downstream application \(e.g., prototype pollution if parsed in JS, or SQL injection if values are used in queries\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:32:46.968957+00:00— report_created — created