Summary
The Nuxt UI ChatPrompt is vulnerable to cross-site scripting (XSS).
User-supplied chat messages are rendered in the browser without proper HTML escaping or sanitization, allowing arbitrary JavaScript execution in the context of the application origin.
In a typical deployment of this template (with authentication and persistent chat history enabled), this can be abused to execute JavaScript in the victim’s browser, steal session data, or perform actions on behalf of authenticated users.
Details
The chat UI takes user input from the message prompt and displays it back in the message list using Nuxt UI chat components. The text content of user messages is rendered as HTML instead of being safely escaped.
Because of this, providing a payload containing a <script> tag in the chat input results in the script being injected into the DOM and executed by the browser when the message is displayed.
Key observations:
- The issue is reproducible on the public demo at
https://chat-template.nuxt.dev/ without authentication.
- Mixed-case tag names and additional attributes are accepted by the browser, which bypass simple string-based filters, indicating that there is either no sanitization or insufficient sanitization in the message rendering pipeline.
PoC
-
Open the live demo:
https://chat-template.nuxt.dev/
-
In the chat input, without logging in, send the following payload as a message:
<sCriPt x>(((confirm("XSS"))))``</scRipt x>
Summary
The Nuxt UI
ChatPromptis vulnerable to cross-site scripting (XSS).User-supplied chat messages are rendered in the browser without proper HTML escaping or sanitization, allowing arbitrary JavaScript execution in the context of the application origin.
In a typical deployment of this template (with authentication and persistent chat history enabled), this can be abused to execute JavaScript in the victim’s browser, steal session data, or perform actions on behalf of authenticated users.
Details
The chat UI takes user input from the message prompt and displays it back in the message list using Nuxt UI chat components. The text content of user messages is rendered as HTML instead of being safely escaped.
Because of this, providing a payload containing a
<script>tag in the chat input results in the script being injected into the DOM and executed by the browser when the message is displayed.Key observations:
https://chat-template.nuxt.dev/without authentication.PoC
Open the live demo:
https://chat-template.nuxt.dev/In the chat input, without logging in, send the following payload as a message: