Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessHost malicious .ckpt on model site
-
DeliveryVictim downloads checkpoint
-
ExploitApp invokes ckpt pickle parser
-
ExecutionSHORT_BINUNICODE sign-confusion triggers oversized memcpy
-
PersistHeap corruption and possible control-flow hijack
-
ImpactCode execution as the user
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation 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 application to call the ckpt loader path on an attacker-supplied PyTorch .ckpt (pickle) checkpoint file - concretely, code reaching ModelLoader::init_from_ckpt_file / read_ckpt_file in src/model.cpp on a file whose pickle stream contains a crafted SHORT_BINUNICODE opcode with a length byte >= 0x80. The CVSS UI:R component is satisfied by the user choosing to load that file (drag-and-drop, CLI argument, GUI 'Load model' button, or downloading via an integrated model browser). No authentication, no network listener, and no special build configuration are required; the vulnerable opcode handler is in the default code path for .ckpt parsing. Limiting factors: AV:L means the attacker cannot reach the parser over the network directly - they must deliver the malicious .ckpt via a model-sharing site, email, or other side channel; deployments that only consume .safetensors files (or that never load externally sourced checkpoints) are not exploitable. |
| Impact | The CVSS 3.1 vector AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H scores 7.8 (High) and accurately reflects a local-file-driven memory corruption: exploitation requires the user to load an attacker-supplied .ckpt file (UI:R), but needs no prior authentication or privileges on the host. EPSS and CISA KEV data were not provided in the input, so probabilistic exploitation likelihood and active-exploitation status are unknown; given the niche audience (developers/researchers running C/C++ diffusion inference), widespread mass exploitation is unlikely, but targeted supply-chain attacks via poisoned models on Hugging Face / Civitai-style sharing sites are a credible scenario. The CVSS H/H/H impact is plausible because heap-overflow-to-RCE in native C/C++ code is well-precedented, but the description correctly hedges with 'could potentially be leveraged for code execution depending on heap layout' - so treat reliable RCE as uncertain and process crash / DoS as the confirmed outcome. No public exploit identified at time of analysis, lowering immediate urgency but not eliminating risk for anyone consuming third-party .ckpt files. |
| Exploit ScenarioDerived | An attacker uploads a malicious 'fine-tuned' diffusion checkpoint to a public model-sharing site with attractive metadata; a developer or end user of a stable-diffusion.cpp-based tool downloads it and invokes the application's standard model-load flow on the .ckpt. While parsing the embedded pickle stream, the SHORT_BINUNICODE handler interprets a crafted 0x80+ length byte as a large negative signed value and calls memcpy with an enormous size, corrupting adjacent heap structures and either crashing the process or, with careful heap grooming, hijacking control flow to run the attacker's code with the user's privileges. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 16, 2026
Heap buffer overflow in stable-diffusion.cpp versions prior to master-584-0a7ae07 allows attackers to corrupt memory and potentially achieve code execution when a victim loads a malicious PyTorch .ckpt checkpoint file. The flaw resides in the SHORT_BINUNICODE opcode handler of the pickle parser in src/model.cpp, where a signed length field is mishandled and passed to memcpy. No public exploit identified at time of analysis, but the upstream fix is committed and the attack surface (untrusted model files from sharing sites) is realistic for AI/ML workloads.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed - update to master-584-0a7ae07 or later by pulling commit 0a7ae07 (https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f, merged via https://github.com/leejet/stable-diffusion.cpp/pull/1443) and rebuilding any application that vendors the library. Until the upgrade is deployed, the vendor-recommended workaround is to refuse to load .ckpt files from untrusted sources and to migrate users to the .safetensors format, which uses a safe, well-defined binary layout instead of pickle; the trade-off is operational, since some legacy community checkpoints are only distributed as .ckpt and will need to be re-exported. As a compensating control, restrict the directory from which .ckpt files can be read to a curated, trusted-author allowlist and reject files originating from user download paths, accepting the UX cost of blocking ad-hoc model imports.
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) developed by leejet, per CPE cpe:2.3:a:leejet:stable-diffusion.cpp. The library supports legacy PyTorch checkpoint (.ckpt) files, which are Python pickle streams containing opcodes that describe object reconstruction. The vulnerable code path is the SHORT_BINUNICODE opcode in src/model.cpp, which reads a 1-byte length prefix. Because the length was treated as a signed value, a byte value >= 0x80 sign-extends to a large negative integer; when implicitly converted to the size_t argument of memcpy, it becomes a very large unsigned length, copying far past the destination heap buffer. This is a classic CWE-787 out-of-bounds write driven by sign confusion in length parsing, and reflects the broader well-known danger of using Python pickle as a deserialization format - which is why the maintainer also restructured the loader into torch_legacy_io and torch_zip_io modules in the fix PR.
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
Exploitation needs the user to open a malicious local .ckpt (AV:L, UI:R) with no auth (PR:N); heap-overflow primitive plausibly yields full C/I/A impact in-process.
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. Versions prior to master-584-0a7ae07 are vulnerable to heap buffer overflow in SHORT_BINUNICODE parsing for PyTorch checkpoint files. The pickle .ckpt parser in src/model.cpp contained a heap buffer overflow vulnerability in the SHORT_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. Any application using affected stable-diffusion.cpp releases to load untrusted .ckpt model files could be vulnerable. A malicious checkpoint file could cause heap corruption through memcpy with an attacker-controlled length. This may lead to process crash and could potentially be leveraged for code execution depending on heap layout. The attack requires the victim or application to load a .ckpt file from an untrusted source, such as a downloaded model from a model sharing site. 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 not loading .ckpt checkpoint files from untrusted sources, and referring to trusted model sources and safer formats such as .safetensors where possible.
Executive ViewAI
A heap buffer overflow in stable-diffusion.cpp (CVE-2026-47749) enables code execution when users load malicious PyTorch checkpoint files; no public exploit identified at time of analysis. Organizations deploying stable-diffusion.cpp to ingest external AI models from repositories or community platforms face direct risk of system compromise, with potential for data exfiltration and lateral movement into enterprise networks.
No vendor-released patch identified at time of analysis. Implement: (1) Disable loading of untrusted checkpoint files; restrict to internally verified sources only; (2) Isolate affected systems on segmented networks with minimal privilege; (3) Container-based execution with restricted capabilities and resource limits; (4) Network egress filtering to detect exfiltration; (5) File integrity monitoring on .ckpt files; (6) Subscribe to stable-diffusion.cpp GitHub releases for patch availability.
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.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
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
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
The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
EUVD-2026-37138
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB