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. Prior to master-764-e22272e, the safetensors loader in src/model_io/safetensors_io.cpp trusts each tensor's data_offsets after checking only that nbytes equals end - begin. A crafted .safetensors file can declare a byte range beyond the file's data section, causing src/model_loader.cpp to consume an attacker-chosen length from an unchecked mapped-file offset. Loading the model can read adjacent process memory into tensor buffers or crash the process. This issue is fixed in master-764-e22272e.
Published: 2026-11-05
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: Information Disclosure
Action: Apply Patch
AI Analysis

Impact

A vulnerability in LeeJet's stable‑diffusion.cpp allows an attacker to craft a .safetensors file that specifies data offsets beyond the actual file content. The library’s loader trusts the provided offsets after only verifying that the reported number of bytes equals the end minus the beginning. This omission enables an out‑of‑bounds read, potentially exposing arbitrary adjacent memory contents into tensor buffers or causing a crash. The impact is primarily confidentiality and process stability, as attacker‑selected data can be read from memory locations not intended to be part of the model.

Affected Systems

The issue exists in LeeJet stable‑diffusion.cpp in any version prior to master‑764‑e22272e. All users employing this library to load safetensors models are vulnerable.

Risk and Exploitability

With a CVSS score of 6.9 the vulnerability is moderate severity. The EPSS score is not available, and it is not listed in the CISA KEV catalog, indicating no confirmed mass exploitation yet. The likely attack vector is local: an attacker who can supply a malicious safetensors file to the application will trigger the out‑of‑bounds read. Proper bounds checking is required to mitigate this risk.

Generated by OpenCVE AI on November 5, 2026 at 16:35 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Obtain and install the updated stable‑diffusion.cpp release master‑764‑e22272e, which validates data offsets.
  • If upgrading immediately is not possible, disable safetensors loading or restrict the path to files that have been verified as trustworthy.
  • Audit the code in src/model_io/safetensors_io.cpp to confirm that all tensor data offsets are validated against the actual file size to prevent future regressions.

Generated by OpenCVE AI on November 5, 2026 at 16:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 05 Nov 2026 17:00:00 +0000

Type Values Removed Values Added
First Time appeared Leejet
Leejet stable-diffusion.cpp
Vendors & Products Leejet
Leejet stable-diffusion.cpp

Thu, 05 Nov 2026 15:45:00 +0000

Type Values Removed Values Added
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. Prior to master-764-e22272e, the safetensors loader in src/model_io/safetensors_io.cpp trusts each tensor's data_offsets after checking only that nbytes equals end - begin. A crafted .safetensors file can declare a byte range beyond the file's data section, causing src/model_loader.cpp to consume an attacker-chosen length from an unchecked mapped-file offset. Loading the model can read adjacent process memory into tensor buffers or crash the process. This issue is fixed in master-764-e22272e.
Title stable-diffusion.cpp: Out-of-bounds read in safetensors loader: unvalidated data_offsets allow a tensor's byte range to extend past the end of the file
Weaknesses CWE-125
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Leejet Stable-diffusion.cpp
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-11-05T15:27:53.815Z

Reserved: 2026-08-04T21:48:08.613Z

Link: CVE-2026-70660

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-11-05T16:17:48.263

Modified: 2026-11-05T16:17:48.263

Link: CVE-2026-70660

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-05T16:45:06Z

Weaknesses