CVE-2026-70660

Description

A flaw was found in stable-diffusion.cpp. The model loader does not properly validate tensor byte offset boundaries when parsing safetensors model files. An attacker could exploit this flaw by enticing a user or service to load a specially crafted model file, causing an out-of-bounds memory read. This can lead to information disclosure by exposing adjacent process memory, or result in a Denial of Service (DoS) from an application crash.

Statement

This vulnerability is rated as Important severity because an out-of-bounds memory read can lead to unauthorized disclosure of adjacent process memory or denial of service, despite requiring user interaction to supply the input. In typical Red Hat environments, exploitation requires an application using this library to ingest and map an untrusted, specially crafted safetensors format file. Workloads that operate strictly on verified, internally hosted diffusion weights without accepting external user-submitted models are not exposed to this risk.

Mitigation

Avoid loading or processing model files (.safetensors) from untrusted or unverified sources. To reduce exposure, restrict model ingestion to verified internal repositories and isolate inference processes within unprivileged containers or sandboxed environments with limited access to host memory and sensitive files.

Caveat: Restricting external model imports may disrupt automated pipelines or third-party workflows that rely on direct downloads of public model weights.

Understanding the Weakness (CWE)

Confidentiality

Technical Impact: Read Memory

An attacker could get secret values such as cryptographic keys, PII, memory addresses, or other information that could be used in additional attacks.

Confidentiality

Technical Impact: Bypass Protection Mechanism

Out-of-bounds memory could contain memory addresses or other information that can be used to bypass ASLR and other protection mechanisms in order to improve the reliability of exploiting a separate weakness for code execution.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

An attacker could cause a segmentation fault or crash by causing memory to be read outside of the bounds of the buffer. This is especially likely when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string.

Other

Technical Impact: Varies by Context

The read operation could produce other undefined or unexpected results.

Frequently Asked Questions

Want to get errata notifications? Sign up here.