Skip to main content
← Vulnerabilities

stable-diffusion.cpp: Out-of-bounds read in safetensors loader: unvalidated data_offsets allow a tensor's byte range to extend past the…

6.9MediumCNA
Exploited
No known exploitation
Fix
Fixed in master-764-e22272e
Who is exposed
Not reported

Do first: Upgrade to a fixed version: master-764-e22272e.

Published
Last modified
7/100 · provisional
None on Exploit-DB, Metasploit or GitHub

Summary

stable-diffusion.cpp, a C/C++ library for running diffusion models, has a flaw in how it loads .safetensors model files: it trusts declared tensor byte ranges without checking they fit inside the file's data section. A local attacker who gets a user to load a specially crafted model file (no login needed, but the user must take action) could read adjacent process memory or crash the process.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

Read the original 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.

cve.now Index

7Pcve.now Index 7 of 100 · methodology v3 · provisional
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure?/25Unknown. No advisory context yet
  • Reach?/20Unknown. No tracked technology or package matched
  • Severity6.9/10CVSS 6.9
  • No patch0/5No signal

What would change the score

  • Would score about 62 if added to CISA KEV
  • Would score about 57 if CISA's SSVC rates exploitation active
  • Would score about 29 if advisories confirm default setups are exposed

What to do

  • Upgrade to a fixed version: master-764-e22272e.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • leejet stable-diffusion.cpp

    fixed in master-764-e22272e

Evidence 4

  1. Advisory
  2. Repository
  3. Repository
  4. Repository

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about CVE-2026-70660

Is CVE-2026-70660 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

Which versions are affected by CVE-2026-70660?

stable-diffusion.cpp: before master-764-e22272e.Source: cve.now feed data

How do I fix CVE-2026-70660?

Upgrade to a fixed version: master-764-e22272e.Source: cve.now feed data