Defenses: No HTTP parameters are used. The page connects to a WebSocket server and injects received messages directly into the DOM using innerHTML.
Welcome to the real-time chat demo. Messages are received instantly via WebSockets.
CONCEPT: WebSockets and DOM XSS
Modern applications often use WebSockets for real-time bidirectional communication. A common mistake is trusting the data coming from the WebSocket server just because it's not a direct HTTP response. If the client-side JavaScript receives a WebSocket message and places it directly into the DOM without sanitization (e.g., using innerHTML instead of textContent), it creates a DOM-based XSS vulnerability. This is especially dangerous in chat apps where an payload sent by one user will be broadcast to and executed on every other connected user's browser.
Live Chat
Note: There is no input field provided on this page. You must interact with the WebSocket directly via your browser's Developer Tools Console.