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.
{
"cna_assigner": "GitHub_M",
"cwe_ids": [
"CWE-125"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/70xxx/CVE-2026-70660.json"
}{
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "master-764-e22272e"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"range": [
{
"fixed": "e22272ee631b742dab4440c18eb8fcafb0689402"
}
],
"source": "REFERENCES_COMMIT"
},
{
"original_tag": "master-764-e22272e",
"range": [
{
"fixed": "e22272ee631b742dab4440c18eb8fcafb0689402"
}
],
"source": "REFERENCES_TAG"
}
]
}
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-70660.json"
[
{
"deprecated": false,
"digest": {
"line_hashes": [
"225410919323531418355905815102518553909",
"145560147219064183343735704866357770886",
"22756467346689772945752183972254928117",
"254964531942448165280825791959251671336",
"290551625191662323538440535966416106525",
"160606830097701528628494064094911750931",
"45890759366334549728818787945904387824",
"134243142539743375237707673838200906098",
"307558635416265794541663393793048034863",
"68694419012915462532077043883919262972",
"163641614099865615575387045393630724381",
"15628555134735019758241466591302028814",
"50099446973400537676036975116024996428",
"199082752463627483896471394878546103633",
"72131161545073802082545063437167395566",
"261429366667066392688894781781671238016",
"44113004501466163248653833595186645258",
"12834285835858280783099229994146384713",
"319808665403707308371989127130566132686"
],
"threshold": 0.9
},
"id": "CVE-2026-70660-0d6737b5",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402",
"target": {
"file": "src/model_io/safetensors_io.cpp"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "92430196325409881274112913304453231647",
"length": 2881
},
"id": "CVE-2026-70660-c7f74786",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402",
"target": {
"file": "src/model_io/safetensors_io.cpp",
"function": "read_safetensors_file"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "181380521012446464284811759816751337250",
"length": 735
},
"id": "CVE-2026-70660-d29add16",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402",
"target": {
"file": "src/model_io/safetensors_io.cpp",
"function": "is_safetensors_file"
}
}
]
"2026-11-14T07:06:34Z"