Skip to content

Interview question · Application & API Security

How can a chat interface become vulnerable to stored XSS through model output?

The model did not write malicious HTML on its own; a web page it summarised did. Then the conversation was shared, and the renderer trusted it.

mediumNewPreparation tags: OpenAI, Anthropic, MicrosoftUpdated Nov 2026

The model did not write malicious HTML on its own; a web page it summarised did. Then the conversation was shared, and the renderer trusted it.

Make your first attempt

What would you say before reading the answer?

  1. 01 State the assumptions your answer depends on.
  2. 02 Explain the mechanism and choose a control.
  3. 03 Name a condition that would change your decision.

The worked answer includes an approach, scoring criteria and follow-up questions. Compare the reasoning with your own.

signing in unlocks more free answers per topic

What if · the follow-ups in this answer

The answer works through 6 follow-ups like an interviewer would

A chat UI renders messages from users and from an LLM as HTML, and conversations can be shared with colleagues by link.

  1. Why is the model's answer attacker-influenced?
  2. What happens when answers are rendered as HTML?
  3. How do you fix the renderer?
  4. What about images and links in answers?
  5. What adds defence in depth?
  6. How would you secure the chat UI?

Each rung has a nudge, a model answer, the principle that carries over and the weak answer to avoid. Sign in free to open it.

UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.