# 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

- Severity: Medium 6.9 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-11-05T15:27:53.815Z
- Modified: 2026-11-12T22:18:35.610Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- leejet stable-diffusion.cpp: < master-764-e22272e

## References

- <https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-v2m4-h57v-fr6w> (exploit)
- <https://github.com/leejet/stable-diffusion.cpp/pull/1754>
- <https://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402>
- <https://github.com/leejet/stable-diffusion.cpp/releases/tag/master-764-e22272e>

## Sources

- CVE List: [CVE-2026-70660](https://www.cve.org/CVERecord?id=CVE-2026-70660), CVE Terms of Use, modified 2026-11-09
- NVD: [CVE-2026-70660](https://nvd.nist.gov/vuln/detail/CVE-2026-70660), Public domain, modified 2026-11-12

---

Page: https://cve.day/CVE-2026-70660 · Whole record: https://cve.day/CVE-2026-70660.json · Rebuilt by cve.day 2026-11-25T22:59:49.128Z
