Report #92152
[gotcha] Attacker injecting system role messages in multi-turn APIs
Strictly validate and sanitize the message history on the server side; reject or escape any user-supplied messages that claim the system role.
Journey Context:
Some chat implementations allow the client to send the full message history back to the API. An attacker can modify the client-side state to insert a message with \`role: system\` into the conversation history, directly overriding the developer's system prompt. The API does not inherently protect against this if the developer blindly passes the client-controlled history through.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:16:04.787213+00:00— report_created — created