CVE-2021-41223: TensorFlow: FusedBatchNorm heap OOB allows data leak/crash
HIGH PoC AVAILABLETensorFlow's FusedBatchNorm kernel contains a heap out-of-bounds read exploitable by any local or containerized process with low privileges — a realistic threat on shared GPU training infrastructure and multi-tenant ML platforms. Immediate impact: memory disclosure (other tenants' batch data, model weights) and training job crashes. Patch to TF 2.7.0, 2.6.1, 2.5.2, or 2.4.4 now; audit any shared notebook or training cluster running unpatched TF versions.
Risk Assessment
Risk is moderate-to-high in shared ML infrastructure contexts. CVSS 7.1 reflects high confidentiality and availability impact with low attack complexity and no user interaction required. The local attack vector limits internet-facing exposure, but in cloud ML platforms (SageMaker, Vertex AI, self-hosted Jupyter hubs) and containerized training pipelines, 'local' means any co-tenant process or compromised notebook. Not in CISA KEV and dated 2021, so active exploitation likelihood is low for patched environments — but unpatched TF instances are common in data science teams with slow upgrade cycles.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
Patch: Upgrade TensorFlow to 2.7.0, 2.6.1, 2.5.2, or 2.4.4 (cherrypicked fix). Apply to all training workers, inference servers, and notebook environments.
-
Verify versions:
pip show tensorflow | grep Versionacross all environments. -
Container hardening: If patching is delayed, enforce seccomp/AppArmor profiles on TF containers to limit memory read scope.
-
Isolation: Run training jobs in dedicated namespaces/VMs rather than shared environments.
-
Detection: Monitor for anomalous TF process crashes (SIGABRT/SIGSEGV in batch norm ops) which may indicate exploitation attempts.
-
Audit: Identify any TF 2.4.x-2.6.x deployments still in production via SBOM or dependency scan.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-41223?
TensorFlow's FusedBatchNorm kernel contains a heap out-of-bounds read exploitable by any local or containerized process with low privileges — a realistic threat on shared GPU training infrastructure and multi-tenant ML platforms. Immediate impact: memory disclosure (other tenants' batch data, model weights) and training job crashes. Patch to TF 2.7.0, 2.6.1, 2.5.2, or 2.4.4 now; audit any shared notebook or training cluster running unpatched TF versions.
Is CVE-2021-41223 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-41223, increasing the risk of exploitation.
How to fix CVE-2021-41223?
1. Patch: Upgrade TensorFlow to 2.7.0, 2.6.1, 2.5.2, or 2.4.4 (cherrypicked fix). Apply to all training workers, inference servers, and notebook environments. 2. Verify versions: `pip show tensorflow | grep Version` across all environments. 3. Container hardening: If patching is delayed, enforce seccomp/AppArmor profiles on TF containers to limit memory read scope. 4. Isolation: Run training jobs in dedicated namespaces/VMs rather than shared environments. 5. Detection: Monitor for anomalous TF process crashes (SIGABRT/SIGSEGV in batch norm ops) which may indicate exploitation attempts. 6. Audit: Identify any TF 2.4.x-2.6.x deployments still in production via SBOM or dependency scan.
What systems are affected by CVE-2021-41223?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, ML inference servers, shared ML notebooks, MLOps platforms.
What is the CVSS score for CVE-2021-41223?
CVE-2021-41223 has a CVSS v3.1 base score of 7.1 (HIGH). The EPSS exploitation probability is 0.02%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. In affected versions the implementation of `FusedBatchNorm` kernels is vulnerable to a heap OOB access. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
Exploitation Scenario
An adversary with access to a shared Jupyter notebook server (e.g., a malicious insider, a compromised data scientist account, or a co-tenant in a multi-user ML platform) crafts a TensorFlow graph that triggers FusedBatchNorm with malformed input tensors. Upon execution, the kernel reads beyond the allocated heap buffer. Depending on heap layout, the attacker may recover fragments of adjacent memory — including mini-batch training data from another user's concurrent training job, partial model checkpoint weights, or authentication tokens cached in the process. Alternatively, the OOB read causes a controlled crash, enabling a targeted denial-of-service against a specific training run.
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/aab9998916c2ffbd8f0592059fad352622f89cda Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-f54p-f6jp-4rhr Exploit Patch 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/adwisatya/SnykVulndb 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