Skip to main content
Vulnerability Database/CVE-2026-111987

CVE-2026-111987: AUTOMATIC1111 Stable Diffusion WebUI XSS

CVE-2026-111987 is a cross-site scripting flaw in AUTOMATIC1111 stable-diffusion-webui that allows remote attackers to inject malicious scripts. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111987 Overview

CVE-2026-111987 is a cross-site scripting (XSS) vulnerability [CWE-79] in AUTOMATIC1111 stable-diffusion-webui versions up to 1.10.1. The flaw resides in the read_metadata_from_safetensors function within modules/sd_models.py, part of the Extra-Networks Card Builder component. Attackers can manipulate the __metadata__.sshs_model_hash argument inside a crafted safetensors model file to inject executable script content. When the web UI renders the model card, the injected payload executes in the browser context of the user. A public proof-of-concept exists, and the project has not responded to the upstream issue report.

Critical Impact

Attackers can execute arbitrary JavaScript in the browser of any user who loads a malicious model file into the stable-diffusion-webui interface, enabling session abuse and UI manipulation.

Affected Products

  • AUTOMATIC1111 stable-diffusion-webui versions through 1.10.1
  • The read_metadata_from_safetensors function in modules/sd_models.py
  • Extra-Networks Card Builder component

Discovery Timeline

  • 2026-10-18 - CVE-2026-111987 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-111987

Vulnerability Analysis

The vulnerability is a stored cross-site scripting flaw triggered when the web UI parses metadata embedded in a safetensors model file. The read_metadata_from_safetensors function extracts the __metadata__.sshs_model_hash field and passes the value into the Extra-Networks Card Builder without proper HTML encoding or sanitization. When the card is rendered in the browser, the attacker-controlled string is interpreted as markup, allowing arbitrary script execution within the authenticated user's session context.

Exploitation requires user interaction: a victim must load or browse a model whose metadata contains the payload. Because stable-diffusion-webui is frequently hosted on shared or remotely accessible instances, model files sourced from third-party repositories represent a realistic delivery channel.

Root Cause

The root cause is missing output encoding on untrusted metadata read from safetensors files. The sshs_model_hash metadata attribute is treated as safe display text instead of untrusted input, violating standard output-encoding practices for web contexts [CWE-79].

Attack Vector

An attacker crafts a safetensors file whose __metadata__.sshs_model_hash field contains an HTML or JavaScript payload. The file is distributed through model-sharing sites, Git repositories, or direct messaging. When a user imports the file and the Extra-Networks Card Builder renders its card, the payload executes in the browser.

Technical details and a proof-of-concept archive are available in the GitHub Issue #17500 Discussion and the GitHub PoC SSH Hash File. Additional context is published at VulDB CVE-2026-111987.

Detection Methods for CVE-2026-111987

Indicators of Compromise

  • Safetensors files whose __metadata__.sshs_model_hash value contains HTML tags, <script> markup, event handler attributes, or JavaScript URIs.
  • Browser console errors or unexpected network requests originating from the stable-diffusion-webui Extra-Networks page.
  • Unexpected outbound HTTP requests from browser sessions interacting with the web UI.

Detection Strategies

  • Scan model repositories and local model directories for safetensors files with metadata fields containing script-like syntax.
  • Instrument the web UI with a strict Content Security Policy (CSP) and alert on CSP violation reports originating from Extra-Networks views.
  • Monitor web proxy logs for anomalous outbound requests from browsers that recently loaded new model cards.

Monitoring Recommendations

  • Log all model imports and record the source URL or filesystem path for later triage.
  • Review browser telemetry for script execution within the stable-diffusion-webui origin.
  • Track access to the Extra-Networks Card Builder endpoint and correlate with newly added model files.

How to Mitigate CVE-2026-111987

Immediate Actions Required

  • Restrict network exposure of stable-diffusion-webui to trusted users and avoid binding it to public interfaces.
  • Only import safetensors files from trusted authors and verify their metadata before loading.
  • Audit existing model directories for files with suspicious metadata fields and remove untrusted content.

Patch Information

No vendor patch is listed in the advisory. The upstream project has been notified through the GitHub Issue #17500 Discussion but has not responded. Monitor the AUTOMATIC1111 stable-diffusion-webui repository for a future release that sanitizes safetensors metadata before rendering.

Workarounds

  • Run stable-diffusion-webui behind an authenticated reverse proxy with a restrictive Content Security Policy that blocks inline scripts.
  • Preprocess safetensors files to strip or sanitize the __metadata__.sshs_model_hash field before import.
  • Use a dedicated browser profile for the web UI to limit the impact of session theft or cookie exposure.
bash
# Example: inspect safetensors metadata before import
python -c "import json, safetensors; from safetensors import safe_open; \
f = safe_open('model.safetensors', framework='pt'); \
print(json.dumps(f.metadata(), indent=2))"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.