Media

ONNX: Denial of service via unchecked expansion of packed sub-byte tensors in ONNX Python APIs

  • Publicada: 28.10.2026
  • Actualizado: 28.10.2026 23:17

Summary

ONNX's Python tensor-materialization helpers could allocate memory according to attacker-controlled tensor dimensions without verifying that a packed sub-byte payload contained the declared number of elements.

A very small model could therefore cause a disproportionately large allocation when an application called onnx.numpy_helper.to_array() or constructed onnx.reference.ReferenceEvaluator with the model. The issue affected UINT2, INT2, UINT4, INT4, and FLOAT4E2M1 tensors stored in either raw_data or packed int32_data.

Technical details

The vulnerable _unpack_2bit() and _unpack_4bit() paths first allocated a small array based on the available packed bytes, then resized it to the shape declared in TensorProto.dims. They did not first confirm that the payload encoded enough logical elements for that shape.

For example, the reporter demonstrated a 66-byte model containing one packed byte and a declared dimension of 700,000,000. The model passed onnx.checker.check_model() and allocated approximately 700 MB while materializing the initializer, followed by another large allocation when executing the reference evaluator.

Loading, checking, or running shape inference on the serialized model alone did not trigger the allocation. The vulnerable tensor had to be materialized.

Impact

An application that materializes packed tensors from an untrusted model can exhaust available memory, causing denial of service. Memory corruption and code execution were not demonstrated.

Affected versions

  • Affected: ONNX through 1.21.0
  • Patched: ONNX 1.22.0

Remediation

Upgrade to ONNX 1.22.0 or later.

The primary fix validates the logical element count before resizing the unpacked NumPy array. A complementary checker change rejects an undersized packed payload before materialization.

The five affected tensor types and both storage formats were re-tested against the published ONNX 1.23.2 wheel and are rejected before the oversized allocation.

To verify the behavior using a released vulnerable package in an isolated environment, install onnx==1.21.0 with python -m pip install "onnx==1.21.0". Run memory-exhaustion demonstrations only with an appropriate process memory limit.

Severity

The vulnerable ONNX component processes the malicious model through a local library API or file boundary and is not itself bound to a network stack. Applications that expose ONNX model processing over a network should calculate an Environmental score with Modified Attack Vector set to Network.

Software afectado

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

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) onnx < 1.22.0 1.22.0

Referencias

Puntuación CVSS 6.2/10
Vector CVSS
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Debilidad (CWE)
CWE-789
Plataforma
Python (PyPI)
Paquete
onnx
Publicada
28.10.2026
Actualizado
28.10.2026 23:17

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-q69g-f4f5-v8m7 - 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 (17) en el archivo
Entradas en total
17
Primera → última
01.2023 10.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

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

Divulgaciones por año

  1. 2023: 1
  2. 2024: 3
  3. 2025: 1
  4. 2026: 12
Gravedad:
  1. ONNX: Denial of service via unchecked expansion of packed sub-byte tensors in ONNX Python APIs esta entrada
    Media · 6.2 CVE-2026-115922 < 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.