Skip to content
HighVulnerability

CVE-2026-70660: stable-diffusion.cpp safetensors loader out-of-bounds read via tensor offsets

Identifier
CVE-2026-70660
Published
Record updated
View JSON

Summary

CVE-2026-70660 affects stable-diffusion.cpp, a pure C/C++ library for diffusion model inference, prior to master-764-e22272e. The safetensors loader in src/model_io/safetensors_io.cpp checks only that nbytes equals end minus begin before trusting each tensor's data_offsets. A crafted .safetensors file can declare a byte range beyond the data section, so src/model_loader.cpp reads an attacker-chosen length from an unchecked mapped-file offset. Loading such a model can leak adjacent process memory into tensor buffers or crash the process.

Mitigation

Fixed in master-764-e22272e.