CVE-2021-29615: TensorFlow: uncontrolled recursion DoS in ParseAttrValue
MEDIUM PoC AVAILABLEA crafted TensorFlow graph attribute triggers unbounded recursion crashing any TF process that parses it—training jobs, model servers, or pipelines loading untrusted graphs. Impact is availability-only (no confidentiality or integrity loss). Patch to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 immediately; if patching is delayed, restrict all TF graph parsing to signed, trusted sources only.
Risk Assessment
Medium operational risk. The local attack vector limits direct remote exploitability, but ML pipelines routinely process model files from semi-trusted sources—artifact registries, collaborative training, third-party checkpoints. Any system loading external TensorFlow graphs or SavedModels is exposed. Low attack complexity means exploitation is straightforward once the attacker influences parsed inputs. Not actively exploited and not in CISA KEV.
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 TF ≥2.5.0 or apply cherry-picked fixes to 2.4.2, 2.3.3, 2.2.3, or 2.1.4.
-
Input trust boundary: Reject untrusted or unsigned TF graphs before they reach ParseAttrValue—validate model provenance via cryptographic signing.
-
Process isolation: Run model loading in sandboxed child processes with ulimit stack constraints to bound crash blast radius.
-
Detection: Alert on unexpected TF process crashes or SIGSEGV signals in serving and training infrastructure logs.
-
Inventory: Audit all TF versions in use via SBOM, pip freeze, or container image scans.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29615?
A crafted TensorFlow graph attribute triggers unbounded recursion crashing any TF process that parses it—training jobs, model servers, or pipelines loading untrusted graphs. Impact is availability-only (no confidentiality or integrity loss). Patch to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 immediately; if patching is delayed, restrict all TF graph parsing to signed, trusted sources only.
Is CVE-2021-29615 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29615, increasing the risk of exploitation.
How to fix CVE-2021-29615?
1. Patch: Upgrade to TF ≥2.5.0 or apply cherry-picked fixes to 2.4.2, 2.3.3, 2.2.3, or 2.1.4. 2. Input trust boundary: Reject untrusted or unsigned TF graphs before they reach ParseAttrValue—validate model provenance via cryptographic signing. 3. Process isolation: Run model loading in sandboxed child processes with ulimit stack constraints to bound crash blast radius. 4. Detection: Alert on unexpected TF process crashes or SIGSEGV signals in serving and training infrastructure logs. 5. Inventory: Audit all TF versions in use via SBOM, pip freeze, or container image scans.
What systems are affected by CVE-2021-29615?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, model registries, CI/CD for ML.
What is the CVSS score for CVE-2021-29615?
CVE-2021-29615 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.01%.
Technical Details
NVD Description
TensorFlow is an end-to-end open source platform for machine learning. The implementation of `ParseAttrValue`(https://github.com/tensorflow/tensorflow/blob/c22d88d6ff33031aa113e48aa3fc9aa74ed79595/tensorflow/core/framework/attr_value_util.cc#L397-L453) can be tricked into stack overflow due to recursion by giving in a specially crafted input. 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 crafts a malicious TensorFlow SavedModel or GraphDef containing deeply nested attribute value structures specifically designed to exhaust the call stack in ParseAttrValue. They upload this to a shared model registry used by the victim's ML platform, or inject it into a federated learning aggregation pipeline. When the victim's infrastructure loads and parses the graph—during model validation in CI, deployment to a TF Serving endpoint, or training checkpoint loading—the TF process crashes with a stack overflow. In a production model serving context, this results in inference downtime. In a training context, it forces job restarts and wastes GPU compute budget.
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/commit/e07e1c3d26492c06f078c7e5bf2d138043e199c1 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-qw5h-7f53-xrp6 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