Skip to main content

stable-diffusion.cpp CVE-2026-47750

| EUVDEUVD-2026-37198 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
    Publish malicious .ckpt on model hub
  2. Delivery
    Victim downloads checkpoint
  3. Exploit
    Application invokes ckpt loader
  4. Execution
    Malformed GLOBAL opcode triggers -1 length
  5. Persist
    Heap buffer overflow in pickle parser
  6. Impact
    Arbitrary code execution as inference process

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 (1) the target application to call stable-diffusion.cpp's legacy .ckpt loader path (is_ckpt_file → init_from_ckpt_file in src/model.cpp), (2) a victim or automated pipeline that loads a .ckpt file the attacker controls, typically downloaded from an untrusted model-sharing site, and (3) the .ckpt to contain a malformed GLOBAL opcode whose argument lacks the terminating newline, causing the parser's newline search to fail and feed -1 as a copy length. Exploitation is LIMITED by the CVSS UI:R requirement (a user or host app must explicitly load the file - opening a .safetensors model or any other supported format is not vulnerable), by AV:L (no network-reachable parser, the attacker cannot reach the code without filesystem-level delivery), and by the fact that applications that have already restricted inputs to .safetensors (a documented best practice in the ML ecosystem) are not exposed.

Impact

The CVSS 3.1 vector AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H justifies the 7.8 base score: local attack vector with required user interaction, but full CIA impact consistent with code execution from heap corruption. No EPSS score, KEV entry, or public POC was provided, so realistic risk is currently driven by the attack scenario rather than observed activity - meaningful but not emergency-tier for most defenders. The most important nuance is the AV:L choice: the bug is triggered by loading a file the victim chose to open, which is correctly modeled as local with UI:R, but in practice .ckpt files are routinely pulled from public model hubs, so the effective reachability resembles a malicious-document scenario more than a traditional local-only flaw. Confidence in technical impact is high (vendor advisory, fix commit, and PR diff all align); confidence in active exploitation is low because no KEV/POC signal is present.

Exploit ScenarioDerived

An attacker uploads a poisoned .ckpt checkpoint to a public model-sharing site (HuggingFace mirror, Civitai-style hub, Discord drop) advertised as a popular fine-tune; the file omits the expected newline after a GLOBAL opcode argument. When a developer, artist, or downstream application loads the model with stable-diffusion.cpp, the parser computes a -1 length, corrupts the heap during the copy, and the attacker uses the resulting write primitive to gain code execution as the user running the inference process. No public exploit identified at time of analysis, but the bug class (controlled-size heap OOB write in a pickle parser) is well within reach of an experienced exploit developer.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.1% 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 the leejet stable-diffusion.cpp pickle .ckpt parser allows arbitrary code execution when a user or host application loads a maliciously crafted checkpoint file. The flaw resides in the GLOBAL opcode handler within src/model.cpp, where missing newline validation lets a -1 length value drive a heap memory copy, corrupting the heap of the diffusion inference process. No public exploit identified at time of analysis, and the issue is not listed in CISA KEV, but the attack surface (community model-sharing sites) makes weaponization plausible.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - upgrade to commit 0a7ae07f948eff4611968a65a22bd7c7031ad74f (referenced as master-584-0a7ae07) from PR https://github.com/leejet/stable-diffusion.cpp/pull/1443, which replaces the legacy ckpt loader with separate torch_legacy_io and torch_zip_io implementations. If you cannot rebuild immediately, the vendor-recommended workaround is to refuse .ckpt inputs entirely and accept only .safetensors models, which uses a non-executable tensor-only format and eliminates the pickle parser as an attack surface; the trade-off is that some community models are only published as .ckpt and will become unusable until reconverted. For environments that must continue accepting .ckpt, restrict loading to files originating from a vetted internal mirror and block direct downloads from public hubs at the proxy or filesystem layer, accepting the operational overhead of curating that mirror. Track the vendor advisory at https://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-v37x-jwp7-mcvc for any follow-up release tagging.

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 runtime for diffusion models (Stable Diffusion, Flux, Wan, Qwen Image, Z-Image), and one of the legacy formats it accepts is the PyTorch pickle-based .ckpt container. The pickle virtual machine includes a GLOBAL opcode that historically reads two newline-terminated strings (module name and qualified name). According to the advisory, the parser searched for the delimiting newline without validating that one was actually found, then used the result as a length, allowing a wraparound to -1 (reinterpreted as a very large size_t) which feeds a downstream copy and writes past the destination heap buffer - a textbook CWE-787 out-of-bounds write, here driven by integer/size mis-handling in pickle stream parsing. The CPE cpe:2.3:a:leejet:stable-diffusion.cpp:*:*:* confirms the affected component is the upstream leejet project itself, and the remediation PR also refactors the loader into separate torch_zip_io and torch_legacy_io modules, indicating the parser was rewritten rather than patched in place.

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

Trigger requires loading an attacker-supplied file locally (AV:L, UI:R); no auth needed (PR:N); heap OOB write in-process yields full CIA impact (C:H/I:H/A:H), no scope change.

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:A/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. In versions prior to master-584-0a7ae07, the pickle .ckpt parser in src/model.cpp contained a heap buffer overflow vulnerability in the GLOBAL opcode handler. The issue was caused by missing validation when searching for newline-delimited fields. A crafted .ckpt file without the expected newline could cause the parser to use -1 as a copy length, resulting in immediate heap corruption. 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 following these instructions: do not load .ckpt checkpoint files from untrusted sources, and prefer trusted model sources and safer formats such as .safetensors where possible.

Executive ViewAI

Why It Matters

leejet stable-diffusion.cpp contains a heap buffer overflow enabling arbitrary code execution when loading malicious checkpoint files from community model repositories, directly threatening organizations whose AI inference systems depend on publicly distributed models. Without available patches, organizations must immediately restrict model sources and isolate inference infrastructure to prevent code execution and lateral movement.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: restrict model loading to internally-curated, cryptographically-verified checkpoint files; run inference processes in containerized/sandboxed environments with minimal privilege; implement network microsegmentation to isolate inference from sensitive systems; maintain immutable audit logs of model loads and process execution.

Threat Intelligence Overview

EPSS Score
0.1%
Top 96% 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.1%
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.

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