Skip to content
statance
MenuClose
medium · CVSS 6.9

CVE-2026-70660

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

Published 5 Nov 2026 · Source updated 5 Nov 2026 · Retrieved 2026-11-06 16:47 UTC

Monitor this CVE ↗Full CVE monitoring on Pro and Business

What happened?

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.

Description supplied by CVE Program. Formatting is simplified; follow the original advisory for full details.

Affected software and versions

Source-provided software and version information
SoftwareVersion informationFixed version
stable-diffusion.cppleejetaffected: < master-764-e22272eSee vendor advisory

Version information comes from the source record and can include unaffected products and exceptions. Distribution packages may contain backported fixes: an older upstream version alone does not prove a server is affected.

Is it being exploited?

This CVE was not listed in the CISA catalogue at our last retrieval. This does not establish that exploitation is absent.

CISA data retrieved 2026-11-06 16:38 UTC. Check CISA ↗

How to respond

  1. Confirm the product, installed package version, and any configuration requirements in the vendor advisory.
  2. Follow the vendor’s remediation or workaround guidance in the references below. Structured fixed-version data is unavailable here; the publisher’s description may include a fix or workaround.
  3. Restart affected services if required, then verify the running version. Known exploitation may warrant investigation as well as patching.

Sources and remediation references

This public advisory does not determine whether a particular server is affected. Records are refreshed as sources change; verify urgent decisions against the original advisory.

← Browse the public CVE feed