Report #86391
[gotcha] Client-side chat history manipulation injecting system role messages
Enforce role validation on the server side. Never allow the client to send messages with the \`system\` or \`assistant\` role that contain user-controlled data without explicit escaping.
Journey Context:
Developers often pass the chat history array directly from the client to the LLM API. Because the API relies on the \`role\` field to distinguish between system instructions and user data, an attacker can modify the client-side JSON payload to inject a message with \`\{"role": "system", "content": "..."\}\`. The LLM will treat this as a legitimate system override, completely bypassing the intended system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:35:37.563440+00:00— report_created — created