CVE-2021-29537: TensorFlow: heap overflow in QuantizedResizeBilinear op

HIGH PoC AVAILABLE
Published May 14, 2021
CISO Take

Any TensorFlow deployment running quantized image processing ops on versions prior to 2.5.0 (or the backport releases) is at risk of heap buffer overflow, potentially leading to code execution within the TF process. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 depending on your pinned version. While the local attack vector limits remote exposure, shared ML infrastructure (Jupyter clusters, multi-tenant GPU nodes, model serving APIs) significantly elevates practical risk.

Risk Assessment

CVSS 7.8 High with local attack vector, low complexity, and low privileges required. In isolated single-user environments risk is moderate, but most enterprise ML infrastructure is multi-tenant: shared Jupyter notebooks, Kubeflow pipelines, and TF Serving deployments expose this to a wider attacker surface. Any authenticated user on a shared ML platform who can submit TF graph operations can trigger this. No active exploitation or KEV listing, but the exploit primitive (heap overflow with controlled data) is attractive for privilege escalation in multi-user GPU clusters.

Affected Systems

Package Ecosystem Vulnerable Range Patched
tensorflow pip No patch
195.0K OpenSSF 7.2 3.7K dependents Pushed today 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
7.8 / 10
EPSS
0.0%
chance of exploitation in 30 days
Higher than 2% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI None
S Unchanged
C High
I High
A High

Recommended Action

1 step
  1. 1) Patch: upgrade to TF 2.5.0 or apply backports to 2.4.2 / 2.3.3 / 2.2.3 / 2.1.4. Verify with pip show tensorflow. 2) Validate quantization thresholds (min/max scalars) before passing to QuantizedResizeBilinear — both must be scalar tensors with finite float values. 3) In TF Serving deployments, enforce input shape and dtype validation at the serving layer to reject malformed quantization parameters before they reach the kernel. 4) Audit multi-tenant Jupyter/Kubeflow environments for unpinned TF versions. 5) Detection: monitor for SIGSEGV/heap corruption signals in TF worker processes, unusual coredumps from model serving pods.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.3 - AI system security
NIST AI RMF
GOVERN-1.1 - Policies and procedures for AI risk management MANAGE-2.2 - Mechanisms to sustain AI system trustworthiness

Frequently Asked Questions

What is CVE-2021-29537?

Any TensorFlow deployment running quantized image processing ops on versions prior to 2.5.0 (or the backport releases) is at risk of heap buffer overflow, potentially leading to code execution within the TF process. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 depending on your pinned version. While the local attack vector limits remote exposure, shared ML infrastructure (Jupyter clusters, multi-tenant GPU nodes, model serving APIs) significantly elevates practical risk.

Is CVE-2021-29537 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2021-29537, increasing the risk of exploitation.

How to fix CVE-2021-29537?

1) Patch: upgrade to TF 2.5.0 or apply backports to 2.4.2 / 2.3.3 / 2.2.3 / 2.1.4. Verify with `pip show tensorflow`. 2) Validate quantization thresholds (min/max scalars) before passing to QuantizedResizeBilinear — both must be scalar tensors with finite float values. 3) In TF Serving deployments, enforce input shape and dtype validation at the serving layer to reject malformed quantization parameters before they reach the kernel. 4) Audit multi-tenant Jupyter/Kubeflow environments for unpinned TF versions. 5) Detection: monitor for SIGSEGV/heap corruption signals in TF worker processes, unusual coredumps from model serving pods.

What systems are affected by CVE-2021-29537?

This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, inference optimization pipelines, edge/mobile model deployment, multi-tenant ML platforms.

What is the CVSS score for CVE-2021-29537?

CVE-2021-29537 has a CVSS v3.1 base score of 7.8 (HIGH). The EPSS exploitation probability is 0.01%.

Technical Details

NVD Description

TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a heap buffer overflow in `QuantizedResizeBilinear` by passing in invalid thresholds for the quantization. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/50711818d2e61ccce012591eeb4fdf93a8496726/tensorflow/core/kernels/quantized_resize_bilinear_op.cc#L705-L706) assumes that the 2 arguments are always valid scalars and tries to access the numeric value directly. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.

Exploitation Scenario

An attacker with low-privileged access to a shared ML platform (e.g., a data scientist account on a Kubeflow cluster, or a shared Jupyter notebook server) crafts a TF graph operation invoking QuantizedResizeBilinear with malformed quantization min/max threshold tensors (e.g., non-scalar tensors or tensors with invalid shapes). When the graph executes, the kernel reads quantization thresholds without bounds checking, triggering a heap buffer overflow. In a multi-tenant GPU node, this could be used to corrupt adjacent memory regions, potentially escalating to code execution within the TF process and enabling lateral movement to access other tenants' model weights, training data, or API credentials stored in the same environment.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
May 14, 2021
Last Modified
November 21, 2024
First Seen
May 14, 2021

Related Vulnerabilities