Skip to main content

stable-diffusion.cpp CVE-2026-47749

| EUVDEUVD-2026-37138 HIGH
Out-of-bounds Write (CWE-787)
2026-06-16 GitHub_M
7.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Host malicious .ckpt on model site
  2. Delivery
    Victim downloads checkpoint
  3. Exploit
    App invokes ckpt pickle parser
  4. Execution
    SHORT_BINUNICODE sign-confusion triggers oversized memcpy
  5. Persist
    Heap corruption and possible control-flow hijack
  6. Impact
    Code 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

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

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

Vendor (GitHub_M) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.2%
Top 95% exploitable
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

CVE-2014-6271 CRITICAL POC
9.8 Sep 24

GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which

CVE-2024-24919 HIGH POC
8.6 May 28

Potentially allowing an attacker to read certain information on Check Point Security Gateways once connected to the inte

CVE-2014-7169 CRITICAL POC
9.8 Sep 25

GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of

CVE-2017-1000083 HIGH POC
7.8 Sep 05

backend/comics/comics-document.c (aka the comic book backend) in GNOME Evince before 3.24.1 allows remote attackers to e

CVE-2026-85102 CRITICAL POC
9.8 Sep 09

Remote code execution in Check Point Quantum Security Gateway arises from improper certificate trust validation during V

CVE-2026-16232 CRITICAL POC
9.3 Jul 22

Authentication bypass in the Check Point SmartConsole login process lets an unauthenticated remote attacker mint a valid

CVE-2026-50751 CRITICAL POC
9.3 Jun 08

Authentication bypass in Check Point Quantum Security Gateway and Spark Firewalls allows unauthenticated remote attacker

CVE-2026-93616 CRITICAL POC
9.8 Sep 22

Unauthenticated attackers who can reach the file-upload interface of Check Point Management Server can combine directory

CVE-2021-3449 MEDIUM
5.9 Mar 25

An OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. Rated med

CVE-2026-85103 CRITICAL POC
9.8 Sep 09

Remote code execution in Check Point Quantum Security Gateway and Quantum Security Management stems from a heap-based bu

CVE-2026-91843 CRITICAL POC
9.8 Sep 16

Unauthenticated remote code execution affects Check Point Quantum Security Management, where a stack-based buffer overfl

CVE-2024-3568 CRITICAL POC
9.6 Apr 10

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy