Junglewise Threat Intelligence

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

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

Technologies: Leejet Stable-Diffusion.Cpp. Vendors: Leejet.

Executive brief

stable-diffusion.cpp is a software library used to run artificial intelligence image generation models. A security flaw in how the library processes certain model files (.ckpt) allows a malicious file to crash the application or potentially take control of the system. To be at risk, a user must manually load a specially crafted, untrusted model file.

Technical details

A heap-based buffer overflow exists in the BINUNICODE opcode handler within src/model.cpp of stable-diffusion.cpp. The vulnerability is caused by sign confusion when validating the opcode length field; an attacker can provide a negative signed integer (e.g., -1) that bypasses length checks but is interpreted as a massive unsigned value (SIZE_MAX) during a subsequent memcpy operation. This leads to immediate heap corruption. Exploitation requires a user to load a malformed .ckpt checkpoint file. The issue is resolved in version master-584-0a7ae07 by refactoring the checkpoint loading logic.

Affected products

  • leejet stable-diffusion.cpp < master-584-0a7ae07

Timeline

  • 2026-04-19: patched: Fix committed in master-584-0a7ae07
  • 2026-05-22: advisory: GitHub Security Advisory published
  • 2026-06-16: disclosed: CVE published to NVD

References

Related threats