| Название | Langflow <= 1.8.3 Stored Cross-Site Scripting |
|---|
| Описание | # Technical Details
A Stored Cross-Site Scripting (XSS) vulnerability exists in the frontend component of Langflow. The application relies on the `Markdown` component to render chat messages and flow descriptions.
The configuration of this Markdown renderer explicitly enables raw HTML decoding using the `rehype-raw` plugin but crucially fails to pair it with a sanitization plugin such as `rehype-sanitize`. This oversight allows arbitrary HTML and JavaScript injected by a user to be rendered directly into the DOM of any user viewing the content.
# Vulnerable Code
File: `src/frontend/src/modals/IOModal/components/chatView/chatMessage/components/edit-message.tsx`
Method: Frontend React Component Rendering
Why: The JSX block `<Markdown rehypePlugins={[rehypeMathjax, rehypeRaw]}>{processedChatMessage}</Markdown>` processes user input. By enabling `rehypeRaw` without `rehypeSanitize`, dangerous tags and attributes (like `<img onerror=...>` or `<script>`) are preserved and executed by the browser.
# Reproduction
1. An authenticated attacker logs into the Langflow GUI.
2. The attacker uses the chat interface to send a message or updates a project's Flow Description.
3. The attacker injects an XSS payload, for example: `<img src=x onerror=alert('XSS_Executed')>`.
4. The backend securely stores this payload in the database without sanitization (which is expected).
5. When the attacker (or any other victim, such as a higher-privileged administrator) views the chat history or the project configuration, the victim's browser renders the malicious Markdown and executes the embedded JavaScript payload.
# Impact
- Session Hijacking: JavaScript execution allows attackers to steal `access_token` values stored in `LocalStorage`.
- Account Takeover and Privileged Actions: Scripts can execute unauthorized asynchronous HTTP API calls on behalf of an administrator, deleting databases or altering security settings.
- Persistent Risk: The payload is stored in the database, impacting every user who accesses the compromised project or chat session.
|
|---|
| Источник | ⚠️ https://gist.github.com/chenhouser2025/935aa5d4556264ba408059eec0960b1a |
|---|
| Пользователь | Eric-f (UID 96873) |
|---|
| Представление | 28.03.2026 14:50 (23 дни назад) |
|---|
| Модерация | 19.04.2026 15:47 (22 days later) |
|---|
| Статус | принято |
|---|
| Запись VulDB | 358235 [langflow-ai langflow до 1.8.3 Frontend React Component Rendering edit-message.tsx межсайтовый скриптинг] |
|---|
| Баллы | 20 |
|---|