CVE-2022-29204: TensorFlow: DoS via UnsortedSegmentJoin input validation
MEDIUM PoC AVAILABLE CISA: TRACK*A missing input validation in TensorFlow's UnsortedSegmentJoin op allows any local low-privilege user to crash ML workloads by passing a negative num_segments value, triggering an assertion failure. Patch to TensorFlow 2.9.0, 2.8.1, 2.7.2, or 2.6.4 immediately—especially on shared ML infrastructure. No data exfiltration or code execution is possible; impact is limited to availability.
Risk Assessment
Low-to-medium operational risk. Remote exploitation is impossible (local access required, low privileges). However, risk escalates significantly in shared ML environments—multi-tenant Jupyter hubs, shared training clusters, or internal model-serving APIs—where a malicious or compromised insider can weaponize this trivially. The assertion-based crash leaves no persistence, but can disrupt long-running training jobs or production inference services.
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.9.0, ≥2.8.1, ≥2.7.2, or ≥2.6.4. 2) Workaround: Add application-layer validation enforcing num_segments > 0 before calling tf.raw_ops.UnsortedSegmentJoin. 3) Detection: Alert on unexpected TensorFlow process exits and grep TF logs for 'CHECK failed' strings. 4) Harden access: Restrict local execution rights on ML training and serving hosts to trusted users only. 5) Inventory: Audit all TensorFlow versions across dev, staging, and production 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-29204?
A missing input validation in TensorFlow's UnsortedSegmentJoin op allows any local low-privilege user to crash ML workloads by passing a negative num_segments value, triggering an assertion failure. Patch to TensorFlow 2.9.0, 2.8.1, 2.7.2, or 2.6.4 immediately—especially on shared ML infrastructure. No data exfiltration or code execution is possible; impact is limited to availability.
Is CVE-2022-29204 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-29204, increasing the risk of exploitation.
How to fix CVE-2022-29204?
1) Patch: Upgrade TensorFlow to ≥2.9.0, ≥2.8.1, ≥2.7.2, or ≥2.6.4. 2) Workaround: Add application-layer validation enforcing num_segments > 0 before calling tf.raw_ops.UnsortedSegmentJoin. 3) Detection: Alert on unexpected TensorFlow process exits and grep TF logs for 'CHECK failed' strings. 4) Harden access: Restrict local execution rights on ML training and serving hosts to trusted users only. 5) Inventory: Audit all TensorFlow versions across dev, staging, and production environments.
What systems are affected by CVE-2022-29204?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, inference endpoints.
What is the CVSS score for CVE-2022-29204?
CVE-2022-29204 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.06%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of `tf.raw_ops.UnsortedSegmentJoin` does not fully validate the input arguments. This results in a `CHECK`-failure which can be used to trigger a denial of service attack. The code assumes `num_segments` is a positive scalar but there is no validation. Since this value is used to allocate the output tensor, a negative value would result in a `CHECK`-failure (assertion failure), as per TFSA-2021-198. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.
Exploitation Scenario
An adversary with a low-privilege account on a shared ML training cluster constructs a minimal TensorFlow graph calling tf.raw_ops.UnsortedSegmentJoin with num_segments=-1. On execution, TensorFlow's internal CHECK macro fires and terminates the process. In a Kubernetes-based model-serving deployment, this crashes the inference pod, causing service unavailability until the pod restarts. In a multi-tenant Jupyter environment, a malicious user could repeatedly trigger the crash to disrupt co-tenants' training runs without leaving obvious forensic traces beyond a process crash.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/core/kernels/unsorted_segment_join_op.cc 3rd Party
- github.com/tensorflow/tensorflow/blob/master/tensorflow/security/advisory/tfsa-2021-198.md Patch 3rd Party
- github.com/tensorflow/tensorflow/commit/20cb18724b0bf6c09071a3f53434c4eec53cc147 Patch 3rd Party
- github.com/tensorflow/tensorflow/commit/84563f265f28b3c36a15335c8b005d405260e943 Patch 3rd Party
- github.com/tensorflow/tensorflow/releases/tag/v2.6.4 Release 3rd Party
- github.com/tensorflow/tensorflow/releases/tag/v2.7.2 Release 3rd Party
- github.com/tensorflow/tensorflow/releases/tag/v2.8.1 Release 3rd Party
- github.com/tensorflow/tensorflow/releases/tag/v2.9.0 Release 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-hx9q-2mx4-m4pg Exploit Patch 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/anonymous-1113/CPE_verify Exploit
- github.com/skipfuzz/skipfuzz Exploit
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