# CVE-2026-70660: stable-diffusion.cpp safetensors buffer overflow [data offset validation]

Source: https://junglewise.ai/threats/cve-2026-70660-stable-diffusion-cpp-is-a-pure-c-c-library-for-running-diffusion  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-05. Updated: 2026-11-05  
License: CC BY 4.0 with a link back

CVE-2026-70660 · Severity: info · Published 2026-11-05

stable-diffusion.cpp is a C/C++ library used to run AI image generation models like Stable Diffusion. A crafted model file can cause the library to read from invalid memory locations when loading, potentially exposing sensitive data from the application's memory or crashing the program. This occurs when processing specially crafted model files that declare data sections outside the file's actual boundaries.

Technologies: [Leejet Stable-Diffusion.Cpp](https://junglewise.ai/threats/technologies/stable-diffusion-cpp). Vendors: [Leejet](https://junglewise.ai/threats/vendors/leejet).

## Quick answers

**Is CVE-2026-70660 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-70660 being exploited in the wild.

**How severe is CVE-2026-70660?** Informational severity, published 5 November 2026.

**Which products and versions are affected?** Leejet Stable-Diffusion.Cpp prior to master-764-e22272e.

**Is there a fix for CVE-2026-70660?** Yes: fixed in master-764-e22272e. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-70660 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-70660?** Check whether you run Leejet Stable-Diffusion.Cpp at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in master-764-e22272e

## Technical details

The safetensors file loader in src/model_io/safetensors_io.cpp performs insufficient validation of tensor data_offsets, checking only that nbytes equals end - begin without verifying the offsets remain within the file's data section. A crafted .safetensors file can declare a byte range extending past the file boundary, causing src/model_loader.cpp to read an attacker-controlled length from an unmapped offset. This allows arbitrary memory read or process crash. The fix validates that tensor offsets stay within declared file data boundaries.

## Affected products

- leejet stable-diffusion.cpp prior to master-764-e22272e

## Timeline

- 2026-11-05: advisory

## References

- [https://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402](https://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402)
- [https://github.com/leejet/stable-diffusion.cpp/pull/1754](https://github.com/leejet/stable-diffusion.cpp/pull/1754)

## Related threats

- [stable-diffusion.cpp heap out-of-bounds write in imatrix loading](https://junglewise.ai/threats/cve-2026-70659-stable-diffusion-cpp-is-a-pure-c-c-library-for-running-diffusion)
- [leejet stable-diffusion.cpp heap buffer overflow in .ckpt parser](https://junglewise.ai/threats/cve-2026-47750-leejet-stable-diffusion-cpp-heap-buffer-overflow-in-ckpt-parser)
- [leejet stable-diffusion.cpp heap buffer overflow in .ckpt parser](https://junglewise.ai/threats/cve-2026-47747-leejet-stable-diffusion-cpp-heap-buffer-overflow-in-ckpt-parser)
- [leejet stable-diffusion.cpp heap buffer overflow in .ckpt parser](https://junglewise.ai/threats/cve-2026-47749-leejet-stable-diffusion-cpp-heap-buffer-overflow-in-ckpt-parser)
- [leejet stable-diffusion.cpp out-of-bounds read in pickle parser](https://junglewise.ai/threats/cve-2026-47748-leejet-stable-diffusion-cpp-out-of-bounds-read-in-pickle-parser)
