CVE-2022-21737: TensorFlow: DoS via malformed Bincount arguments
MEDIUM PoC AVAILABLE CISA: TRACK*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 |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
1 step-
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
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
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.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/bincount_op.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/7019ce4f68925fd01cdafde26f8d8c938f47e6f9 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-f2vv-v9cg-qhh7 Patch 3rd Party
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2020-15205 9.8 TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow
AI Threat Alert