xss
AI security interview questions tagged xss, across every topic.
6 questions · 2 unlocked for you
Concepts behind "xss"
Explanations of the mechanisms these questions rely on.
Foundational
Cross-Site Scripting and Output EncodingCross-site scripting (XSS) is injection into a browser: attacker-controlled content ends up in a page as executable script, running with the site's origin and the victim's session. It comes in stored, reflected and DOM-based forms. The fixes are contextual output encoding (frameworks do this by default), sanitisation when HTML must be rendered, and a strict Content Security Policy as a second layer. Chat interfaces that render model output as HTML or Markdown are a new and common source. Application Security
Foundational
Insecure Output HandlingInsecure (or improper) output handling, LLM10 in the OWASP Top 10 for LLM Applications 2026 (LLM05 in 2025), is passing model output to a browser, database, shell, template engine, URL fetcher or other interpreter without the validation and encoding you would apply to user input. Because output is shaped by every author in the model's context, an attacker who can influence the context can reach those interpreters, recreating cross-site scripting, SQL injection, command injection and SSRF. LLM Application Security
Core
Content Security Policy in DepthA Content Security Policy is a response header the browser enforces for one document: it decides which scripts, styles, frames and connections the page may use, blocks the rest and can report violations. Host allowlists failed in practice because allowed domains host code an attacker can reuse. A strict policy trusts scripts by per-response nonce or by hash, propagates trust with strict-dynamic, and adds object-src and base-uri. Trusted Types closes DOM sinks. CSP limits XSS impact; it does not fix XSS or stop data leaving. Application SecuritySign in