Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessHost malicious .ckpt on model-sharing site
-
DeliveryVictim downloads and loads checkpoint
-
ExploitParser hits crafted BINUNICODE opcode
-
ExecutionSign-confused length passed to memcpy
-
PersistHeap buffer overflow corrupts adjacent metadata
-
ImpactAttacker-controlled code execution in inference process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to load an attacker-supplied .ckpt (pickle) checkpoint file with a vulnerable build of stable-diffusion.cpp prior to master-584-0a7ae07; the vulnerable code path is reached only when init_from_file dispatches into the legacy ckpt loader (is_ckpt_file true), so files in .safetensors or other non-pickle formats do not trigger it. The attack vector is local (AV:L) - the malicious file must reach the host filesystem or be supplied to an application that reads local paths - and user interaction is required (UI:R) to initiate model loading; no authentication to the library itself is needed (PR:N). Risk is therefore limited in environments that only load vendor-signed or hash-pinned checkpoints, that have already migrated to .safetensors, or that sandbox the inference process, and is elevated in workflows that ingest community or user-uploaded checkpoints without provenance checks. |
| Impact | The CVSS 3.1 vector AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H accurately characterizes this as a local, user-interaction-required file-parsing bug with full CIA impact - consistent with a memory-corruption primitive triggered when a user voluntarily loads a malicious model. There is no CISA KEV listing and no public exploit identified at time of analysis, and no EPSS score was supplied; SSVC data is also absent. Real-world risk is moderated by the need for the victim to choose to load an attacker-supplied .ckpt, but it is elevated by the strong social-engineering pull of the AI/model-sharing ecosystem (Hugging Face, Civitai, random GitHub releases) where users routinely load untrusted checkpoints - a threat model essentially identical to the well-known PyTorch pickle deserialization risk. Heap overflows in C/C++ pickle parsers are typically convertible to arbitrary code execution with moderate effort, so this should be treated as a priority patch for any product or pipeline that exposes stable-diffusion.cpp to user-supplied checkpoints, even though the CVSS base score is only High rather than Critical. |
| Exploit ScenarioDerived | An attacker uploads a malicious .ckpt model to a public model-sharing site or sends it directly to a target (e.g., an artist, ML engineer, or an automated image-generation service that ingests user-supplied models). When the victim loads the file with a vulnerable stable-diffusion.cpp build, the crafted BINUNICODE opcode triggers a heap overflow during parsing, corrupting adjacent heap metadata and giving the attacker a primitive that can plausibly be developed into arbitrary code execution in the inference process. No public exploit identified at time of analysis, but the bug class and the open-source patch make weaponization feasible for a motivated researcher. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 16, 2026
Heap-based buffer overflow in stable-diffusion.cpp's pickle .ckpt parser allows attackers to corrupt memory and likely achieve code execution when a victim loads a maliciously crafted checkpoint file. The flaw stems from sign confusion in the BINUNICODE opcode length field, causing memcpy to be called with an attacker-controlled, effectively gigantic size derived from a negative signed integer. No public exploit identified at time of analysis, and the issue is fixed in master-584-0a7ae07.
RemediationAI
Vendor-released patch: master-584-0a7ae07 - update stable-diffusion.cpp (and rebuild any embedding application) to this revision or later, per GHSA-mghm-5mqc-pwmp and PR #1443. If immediate upgrade is impossible, the vendor-recommended workaround is to load .ckpt checkpoint files only from trusted sources and to prefer the .safetensors format wherever the model is available, since .safetensors uses a non-executable tensor-only layout that does not exercise the vulnerable pickle parser; the trade-off is that some community models are distributed only as .ckpt and would have to be re-converted or skipped. As additional compensating controls, restrict the directories from which the application reads checkpoints, run inference processes under a low-privilege account with no network egress and with seccomp/AppArmor confinement, and gate uploaded models through a server-side check that rejects pickle-format files, accepting only .safetensors.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
stable-diffusion.cpp is a pure C/C++ inference library for diffusion models (Stable Diffusion, Flux, Wan, Qwen Image, Z-Image) maintained by leejet, identified by CPE cpe:2.3:a:leejet:stable-diffusion.cpp. To remain compatible with the PyTorch ecosystem it implements its own parser for the Python pickle format used inside legacy .ckpt/.pt/.pth checkpoints. Pickle is a stack-based serialization format whose BINUNICODE opcode is followed by a 4-byte little-endian length and that many UTF-8 bytes; the vulnerable handler in src/model.cpp read this length into a signed type, then passed it to memcpy. A length with the high bit set was interpreted as a negative number and, when implicitly converted to the size_t argument of memcpy, became a multi-gigabyte copy into a small heap buffer, classic CWE-122 (heap-based buffer overflow). The upstream fix (PR #1443, commit 0a7ae07) restructures checkpoint loading into separate torch_legacy_io and torch_zip_io modules that replace the old ckpt_io path.
Know when Checkpoint gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Triggered by parsing a local attacker-supplied file (AV:L, UI:R), no auth to the library (PR:N), reliable sign-confusion overflow (AC:L), heap RCE gives full CIA (C/I/A:H).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
stable-diffusion.cpp is a pure C/C++ library for running diffusion model (Stable Diffusion, Flux, Wan, Qwen Image, Z-Image, and more) inference. In versions prior to master-584-0a7ae07, the pickle .ckpt parser in src/model.cpp contained a heap buffer overflow vulnerability in the BINUNICODE opcode handler. The issue was caused by sign confusion on the opcode length field. A crafted .ckpt file could trigger memcpy with a very large length derived from a negative signed value, causing immediate heap corruption. The issue has been resolved in version master-584-0a7ae07. If developers are unable to immediately update their applications they can work around this issue by only loading .ckpt checkpoint files from trusted sources and preferring trusted model sources and safer formats such as .safetensors where possible.
Executive ViewAI
A heap buffer overflow in stable-diffusion.cpp's checkpoint parser allows code execution when users load maliciously crafted model files. This affects any team or individual using stable-diffusion.cpp for local ML inference, creating a path for attackers to compromise systems handling untrusted model weights.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) implement file integrity signing for all checkpoint files; (2) restrict model loading to curated, cryptographically-verified sources; (3) isolate stable-diffusion.cpp execution in sandboxed or containerized environments with minimal network access; (4) monitor for the upstream fix in source repository (master-584-0a7ae07 available in development branch) and prioritize deployment when formally released.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
More in Checkpoint
View allGNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which
Potentially allowing an attacker to read certain information on Check Point Security Gateways once connected to the inte
GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of
backend/comics/comics-document.c (aka the comic book backend) in GNOME Evince before 3.24.1 allows remote attackers to e
Remote code execution in Check Point Quantum Security Gateway arises from improper certificate trust validation during V
Authentication bypass in the Check Point SmartConsole login process lets an unauthenticated remote attacker mint a valid
Authentication bypass in Check Point Quantum Security Gateway and Spark Firewalls allows unauthenticated remote attacker
Unauthenticated attackers who can reach the file-upload interface of Check Point Management Server can combine directory
Local privilege escalation in Check Point Gaia OS lets an authenticated local user execute commands as root by writing t
An OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. Rated med
Remote code execution in Check Point Quantum Security Gateway and Quantum Security Management stems from a heap-based bu
Unauthenticated remote code execution affects Check Point Quantum Security Management, where a stack-based buffer overfl
EUVD-2026-37204
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB