CVE-2026-70659
Awaiting Analysis Awaiting Analysis - Queue

Heap Buffer Overflow in Stable Diffusion.cpp

Vulnerability report for CVE-2026-70659, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-11-05

Last updated on: 2026-11-12

Assigner: GitHub, Inc.

Description

stable-diffusion.cpp is a pure C/C++ library for running diffusion model (Stable Diffusion, Flux, Wan, Qwen Image, Z-Image, and more) inference. From master-742-1a13107 until master-763-4fcc6fe, IMatrixCollector::load_imatrix in src/runtime/imatrix.cpp reuses the values and counts vectors for entries with the same tensor name but resizes them only when they are empty. An untrusted .imatrix file can provide a small nval for the first entry and a larger nval for a second entry with the same name, causing the accumulation loop to write attacker-controlled floating-point and integer values beyond both heap buffers. Loading the file through the --imat-in conversion path can corrupt the heap or crash the process before a model is required. This issue is fixed in master-763-4fcc6fe.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-11-05
Last Modified
2026-11-12
Generated
2026-11-13
AI Q&A
2026-11-05
EPSS Evaluated
2026-11-12
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
leejet stable-diffusion.cpp < master-763-4fcc6fe

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.
CWE-1284 The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This is a heap out-of-bounds write vulnerability in the stable-diffusion.cpp library. It occurs in the IMatrixCollector::load_imatrix function when processing untrusted .imatrix files. The issue arises when duplicate tensor names are provided with inconsistent value counts. The function only resizes internal buffers for empty entries, causing the second entry to write beyond allocated memory when its value count exceeds the first entry's count.

Detection Guidance

This vulnerability is triggered by loading a maliciously crafted .imatrix file through stable-diffusion.cpp. To detect it, inspect any .imatrix files in your system for duplicate tensor names with inconsistent value counts. Check logs for crashes or heap corruption errors during model loading.

Impact Analysis

An attacker could exploit this to corrupt heap memory or crash the process when loading a specially crafted .imatrix file. This could lead to denial of service or potentially allow further exploitation if combined with other vulnerabilities. The attack requires user interaction to load the malicious file.

Compliance Impact

This vulnerability does not directly affect compliance with GDPR or HIPAA as it pertains to a heap out-of-bounds write in a local software library. However, if exploited, it could lead to arbitrary code execution or crashes, potentially compromising system integrity or availability. Such compromises might indirectly impact compliance if they result in unauthorized data access or processing disruptions, depending on the system's role in handling sensitive data.

Mitigation Strategies

Update stable-diffusion.cpp to the patched version (master-763-4fcc6fe or later). Avoid loading untrusted .imatrix files. If you must process such files, validate their structure manually before use to ensure no duplicate tensor names with mismatched value counts exist.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-70659. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...