# CVE-2026-47750: leejet stable-diffusion.cpp heap buffer overflow in .ckpt parser

Source: https://junglewise.ai/threats/cve-2026-47750-leejet-stable-diffusion-cpp-heap-buffer-overflow-in-ckpt-parser  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-16. Updated: 2026-06-16  
License: CC BY 4.0 with a link back

CVE-2026-47750 · Severity: high · CVSS 7.8 · Published 2026-06-16

stable-diffusion.cpp is a library used to run AI image generation models. A security flaw in how it processes certain model files (.ckpt) allows a malicious file to crash the application or potentially take control of the system. This risk occurs when a user downloads and opens a compromised AI model from an untrusted source.

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-47750 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-47750 being exploited in the wild.

**How severe is CVE-2026-47750?** High severity, with a CVSS score of 7.8, published 16 June 2026.

**Which products and versions are affected?** Leejet Stable-Diffusion.Cpp prior to master-584-0a7ae07.

**Is there a fix for CVE-2026-47750?** A patch was published on 2026-04-19: Fix committed to master branch Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

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

**Am I affected by CVE-2026-47750?** 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.

## Technical details

A heap buffer overflow exists in the pickle .ckpt parser within src/model.cpp, specifically in the GLOBAL opcode handler. The vulnerability is caused by missing validation when searching for newline-delimited fields using find_char(). If a crafted .ckpt file lacks the expected newline, find_char() returns -1, which is then passed to memcpy() as a length argument. Because memcpy() expects a size_t, the -1 is interpreted as a very large unsigned integer (SIZE_MAX), leading to immediate heap corruption. Exploitation requires a user to load a malicious model file. The issue was addressed in version master-584-0a7ae07 by implementing restricted checkpoint loading.

## Affected products

- leejet stable-diffusion.cpp prior to master-584-0a7ae07

## Timeline

- 2026-04-19: patched: Fix committed to master branch
- 2026-05-22: advisory: GitHub Security Advisory published
- 2026-06-16: disclosed: CVE published to NVD

## References

- [https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f](https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f)
- [https://github.com/leejet/stable-diffusion.cpp/pull/1443](https://github.com/leejet/stable-diffusion.cpp/pull/1443)
- [https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-v37x-jwp7-mcvc](https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-v37x-jwp7-mcvc)

## Related threats

- [stable-diffusion.cpp safetensors buffer overflow [data offset validation]](https://junglewise.ai/threats/cve-2026-70660-stable-diffusion-cpp-is-a-pure-c-c-library-for-running-diffusion)
- [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-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)
