CVE-2022-21737: TensorFlow: DoS via malformed Bincount arguments

MEDIUM PoC AVAILABLE CISA: TRACK*
Published February 3, 2022
CISO Take

TensorFlow deployments on versions prior to 2.8.0 are vulnerable to a denial-of-service attack through malformed Bincount operation inputs. An authenticated attacker with low privileges can crash TF Serving processes by sending crafted tensor arguments, taking down inference endpoints until manually restarted. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately; if patching is delayed, restrict API access and add server-side input shape validation.

Risk Assessment

Medium risk in practice. CVSS 6.5 with network-accessible vector, low complexity, and only low privileges required makes this straightforwardly exploitable by any authenticated API consumer — no special ML expertise needed. Impact is bounded to availability (A:H) with no confidentiality or integrity compromise. Risk is elevated in production ML serving environments with uptime SLAs or shared multi-tenant inference infrastructure, but reduced by the authentication requirement and confirmed absence of active exploitation or KEV listing.

Affected Systems

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

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
6.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 44% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
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 Network
AC Low
PR Low
UI None
S Unchanged
C None
I None
A High

Recommended Action

1 step
  1. 1) Patch: upgrade TensorFlow to 2.8.0, 2.7.1, 2.6.3, or 2.5.3 — patches are available for all affected supported branches. 2) Workaround: enforce server-side input validation rejecting tensors with out-of-range shapes or values before they reach Bincount kernels. 3) Detection: instrument TF Serving logs for CHECK-fail messages or SIGABRT signals; alert on abnormal serving process restart frequency. 4) Defense-in-depth: enforce strict API authentication, enforce per-client rate limiting, and isolate TF Serving processes per tenant to minimize blast radius in shared environments.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
Clause 6.1 - Actions to address AI risks and opportunities
NIST AI RMF
MANAGE-2.2 - Deployed AI system risks are managed
OWASP LLM Top 10
LLM10 - Unbounded Consumption

Frequently Asked Questions

What is CVE-2022-21737?

TensorFlow deployments on versions prior to 2.8.0 are vulnerable to a denial-of-service attack through malformed Bincount operation inputs. An authenticated attacker with low privileges can crash TF Serving processes by sending crafted tensor arguments, taking down inference endpoints until manually restarted. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately; if patching is delayed, restrict API access and add server-side input shape validation.

Is CVE-2022-21737 actively exploited?

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

How to fix CVE-2022-21737?

1) Patch: upgrade TensorFlow to 2.8.0, 2.7.1, 2.6.3, or 2.5.3 — patches are available for all affected supported branches. 2) Workaround: enforce server-side input validation rejecting tensors with out-of-range shapes or values before they reach Bincount kernels. 3) Detection: instrument TF Serving logs for CHECK-fail messages or SIGABRT signals; alert on abnormal serving process restart frequency. 4) Defense-in-depth: enforce strict API authentication, enforce per-client rate limiting, and isolate TF Serving processes per tenant to minimize blast radius in shared environments.

What systems are affected by CVE-2022-21737?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference.

What is the CVSS score for CVE-2022-21737?

CVE-2022-21737 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 0.22%.

Technical Details

NVD Description

Tensorflow is an Open Source Machine Learning Framework. The implementation of `*Bincount` operations allows malicious users to cause denial of service by passing in arguments which would trigger a `CHECK`-fail. There are several conditions that the input arguments must satisfy. Some are not caught during shape inference and others are not caught during kernel implementation. This results in `CHECK` failures later when the output tensors get allocated. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Exploitation Scenario

An adversary obtains valid low-privilege credentials to a TF Serving instance — via a leaked service account token, misconfigured internal API, or a shared multi-tenant inference platform. They craft a prediction request with tensor arguments designed to pass TensorFlow's shape inference checks but trigger a CHECK-fail during Bincount kernel execution. The serving process terminates abnormally, causing a denial of service for all concurrent users. By sending requests faster than the process restarts — trivial with low-complexity network access — the adversary sustains the outage. This is particularly disruptive in CI/CD pipelines relying on online inference for model evaluation, or in production serving with tight availability SLAs.

CVSS Vector

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

Timeline

Published
February 3, 2022
Last Modified
May 5, 2025
First Seen
February 3, 2022

Related Vulnerabilities