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-111985 Overview
CVE-2026-111985 affects AUTOMATIC1111 stable-diffusion-webui versions up to 1.10.1. The vulnerability resides in the read_metadata_from_safetensors function within modules/sd_models.py, which handles metadata extraction from safetensors model files. An attacker can manipulate the header length field to trigger uncontrolled resource allocation [CWE-400]. The attack is launched remotely and requires user interaction to load a crafted model file. A public proof-of-concept is available, and the project maintainers have not responded to the issue report at the time of publication.
Critical Impact
Remote attackers can cause resource exhaustion on stable-diffusion-webui instances by supplying a malformed safetensors file with a crafted header length, leading to availability degradation.
Affected Products
- AUTOMATIC1111 stable-diffusion-webui up to version 1.10.1
- Component: Metadata Extraction (modules/sd_models.py)
- Function: read_metadata_from_safetensors
Discovery Timeline
- 2026-10-18 - CVE-2026-111985 published to NVD
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-111985
Vulnerability Analysis
The flaw is a resource exhaustion issue classified under [CWE-400] (Uncontrolled Resource Consumption). It occurs when read_metadata_from_safetensors parses the header length field of a safetensors file without validating the declared size against reasonable bounds or available system memory. When the function encounters an attacker-controlled header length value, it allocates memory proportional to that declared size before verifying that the actual file content supports the claim.
The safetensors format begins with an 8-byte little-endian integer specifying the length of a JSON metadata header. The vulnerable code trusts this value and attempts to read or allocate buffers accordingly. A malicious file declaring an inflated header length forces the process to consume excessive memory or CPU cycles during parsing.
Root Cause
The root cause is missing input validation on the header length field during safetensors metadata parsing. The function does not enforce an upper bound on the declared header size, nor does it cross-check the value against the actual file length. This design assumption that files are well-formed enables resource exhaustion attacks.
Attack Vector
Exploitation requires an attacker to deliver a crafted safetensors file to a running stable-diffusion-webui instance and have it processed through the metadata extraction path. In deployments where users can upload models or where the web UI is exposed to untrusted input, remote exploitation is possible. User interaction is required to load or scan the malicious model file.
The vulnerability mechanism is described in prose only, as no verified exploit code is included here. A proof-of-concept archive is referenced by the GitHub Issue Tracker #17498 and the GitHub PoC File.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-111985
Indicators of Compromise
- Unexpected memory spikes in Python processes hosting stable-diffusion-webui during model-loading operations
- Safetensors files whose declared header length (first 8 bytes) exceeds the actual file size
- Repeated process crashes or out-of-memory conditions coinciding with model upload or scan events
Detection Strategies
- Instrument the model-loading pipeline to log and alert on safetensors files with header length fields exceeding a defined threshold (for example, 100 MB)
- Monitor the stable-diffusion-webui process for abnormal resident memory growth and correlate with recent file access events
- Inspect inbound uploads and shared model repositories for safetensors files that fail structural validation
Monitoring Recommendations
- Track process-level memory consumption and OOM-killer events on hosts running stable-diffusion-webui
- Collect application logs covering metadata parsing failures and exceptions from modules/sd_models.py
- Alert when the service becomes unresponsive after processing a user-supplied model file
How to Mitigate CVE-2026-111985
Immediate Actions Required
- Restrict stable-diffusion-webui exposure to trusted networks and authenticated users only
- Disallow uploads of untrusted safetensors files from external sources
- Apply resource limits (cgroups, systemd MemoryMax) to the service process to contain impact
- Validate safetensors files before loading by checking that the declared header length does not exceed the actual file size
Patch Information
No vendor patch is available at the time of publication. The project maintainers have not responded to the issue report. Monitor the GitHub Project Repository and GitHub Issue Tracker #17498 for updates. Additional vulnerability tracking is available via VulDB CVE-2026-111985.
Workarounds
- Pre-screen all safetensors files with a validator that enforces a maximum header size and verifies length consistency against the file footprint
- Run stable-diffusion-webui inside a container with strict memory limits to bound the blast radius of resource exhaustion
- Restrict access to the web UI using network segmentation, authentication, and reverse-proxy allowlists
- Disable automated metadata scanning of untrusted model directories until a fix is available
# Example: constrain the service with systemd memory limits
# /etc/systemd/system/sd-webui.service.d/limits.conf
[Service]
MemoryMax=8G
MemoryHigh=6G
TasksMax=512
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

