CVE-2021-29532: TensorFlow: heap OOB read via RaggedCross op
HIGH PoC AVAILABLETensorFlow's RaggedCross kernel operation lacks bounds validation on user-supplied tensor indices, enabling heap out-of-bounds reads that can disclose adjacent process memory or crash ML workloads. Any environment where untrusted users submit TensorFlow operations — shared Jupyter clusters, TF Serving endpoints — is the primary exposure surface. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4.
Risk Assessment
Moderate-to-high risk for multi-tenant ML infrastructure. CVSS 7.1 with local attack vector and low-privilege requirement means shared training clusters and notebook environments are the primary blast radius. Confidentiality impact is high (heap memory disclosure) and availability impact is high (process crash). Not in CISA KEV with no reported active exploitation, reducing immediate urgency, but low attack complexity makes this trivially weaponizable by any authorized platform user.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch: Upgrade to TensorFlow 2.5.0, or apply cherry-picked fixes in 2.4.2, 2.3.3, 2.2.3, or 2.1.4.
-
Workaround: Restrict access to tf.raw_ops.RaggedCross via TF op allowlisting in serving environments if patching is delayed.
-
Network controls: Do not expose raw TF op execution to untrusted clients; restrict TF Serving endpoints to authenticated internal consumers only.
-
Detection: Monitor for abnormal process crashes or heap corruption signals (SIGSEGV, abort traps) in TF workloads.
-
Container isolation: Run TF workloads in isolated containers per-user or per-tenant to limit memory disclosure blast radius.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29532?
TensorFlow's RaggedCross kernel operation lacks bounds validation on user-supplied tensor indices, enabling heap out-of-bounds reads that can disclose adjacent process memory or crash ML workloads. Any environment where untrusted users submit TensorFlow operations — shared Jupyter clusters, TF Serving endpoints — is the primary exposure surface. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4.
Is CVE-2021-29532 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29532, increasing the risk of exploitation.
How to fix CVE-2021-29532?
1. Patch: Upgrade to TensorFlow 2.5.0, or apply cherry-picked fixes in 2.4.2, 2.3.3, 2.2.3, or 2.1.4. 2. Workaround: Restrict access to tf.raw_ops.RaggedCross via TF op allowlisting in serving environments if patching is delayed. 3. Network controls: Do not expose raw TF op execution to untrusted clients; restrict TF Serving endpoints to authenticated internal consumers only. 4. Detection: Monitor for abnormal process crashes or heap corruption signals (SIGSEGV, abort traps) in TF workloads. 5. Container isolation: Run TF workloads in isolated containers per-user or per-tenant to limit memory disclosure blast radius.
What systems are affected by CVE-2021-29532?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, shared ML notebook platforms.
What is the CVSS score for CVE-2021-29532?
CVE-2021-29532 has a CVSS v3.1 base score of 7.1 (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 force accesses outside the bounds of heap allocated arrays by passing in invalid tensor values to `tf.raw_ops.RaggedCross`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/efea03b38fb8d3b81762237dc85e579cc5fc6e87/tensorflow/core/kernels/ragged_cross_op.cc#L456-L487) lacks validation for the user supplied arguments. Each of the above branches call a helper function after accessing array elements via a `*_list[next_*]` pattern, followed by incrementing the `next_*` index. However, as there is no validation that the `next_*` values are in the valid range for the corresponding `*_list` arrays, this results in heap OOB reads. 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 adversary with low-privilege access to a shared ML training platform (e.g., corporate JupyterHub or ML experimentation environment) submits a crafted notebook calling tf.raw_ops.RaggedCross with deliberately invalid tensor index values. Missing bounds validation on next_* counters causes heap OOB reads into adjacent memory — potentially leaking model weights, training batch data, or authentication tokens from co-tenant sessions sharing the same Python process. In a TF Serving deployment, a client can send crafted gRPC inference requests with malformed RaggedTensor payloads to repeatedly crash the serving process, causing sustained availability impact on ML-powered downstream applications.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H References
- github.com/tensorflow/tensorflow/commit/44b7f486c0143f68b56c34e2d01e146ee445134a Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-j47f-4232-hvv8 Exploit 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