CVE-2022-41880: TensorFlow: heap OOB read in candidate sampler op
CRITICAL PoC AVAILABLE CISA: TRACK*TensorFlow's BaseCandidateSamplerOp is exploitable without authentication over the network — any TF deployment accepting untrusted tensor inputs is at risk of memory disclosure or crash. Patch immediately to TF 2.11+ or the backport releases (2.10.1, 2.9.3, 2.8.4). If serving endpoints accept external input and cannot be patched immediately, add input validation to enforce true_classes ≤ range_max at the API layer.
Risk Assessment
CVSS 9.1 Critical with network/no-auth/no-interaction vector represents maximum exposure for any internet-facing TF serving endpoint. The heap OOB read (CWE-125) can expose adjacent process memory — in ML serving contexts this may include model weights, training data fragments, or in-memory credentials, making the effective impact higher than a standard process crash. Low attack complexity means exploitation requires minimal adversary skill once the endpoint is identified.
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-
Upgrade to TensorFlow 2.11+. Backports available for 2.10.1, 2.9.3, and 2.8.4 — apply the cherry-pick commit b389f5c944cadfdfe599b3f1e4026e036f30d2d4 if upgrading major version is not immediately feasible.
-
Add input validation at API ingestion to reject any true_classes tensor containing values exceeding configured range_max.
-
Audit all public-facing TF Serving deployments for untrusted tensor input exposure.
-
Apply process-level sandboxing (seccomp/AppArmor/gVisor) to TF serving containers to contain crash blast radius.
-
Monitor serving logs for anomalous OOM or SIGABRT events as potential exploitation indicators.
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-41880?
TensorFlow's BaseCandidateSamplerOp is exploitable without authentication over the network — any TF deployment accepting untrusted tensor inputs is at risk of memory disclosure or crash. Patch immediately to TF 2.11+ or the backport releases (2.10.1, 2.9.3, 2.8.4). If serving endpoints accept external input and cannot be patched immediately, add input validation to enforce true_classes ≤ range_max at the API layer.
Is CVE-2022-41880 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-41880, increasing the risk of exploitation.
How to fix CVE-2022-41880?
1. Upgrade to TensorFlow 2.11+. Backports available for 2.10.1, 2.9.3, and 2.8.4 — apply the cherry-pick commit b389f5c944cadfdfe599b3f1e4026e036f30d2d4 if upgrading major version is not immediately feasible. 2. Add input validation at API ingestion to reject any true_classes tensor containing values exceeding configured range_max. 3. Audit all public-facing TF Serving deployments for untrusted tensor input exposure. 4. Apply process-level sandboxing (seccomp/AppArmor/gVisor) to TF serving containers to contain crash blast radius. 5. Monitor serving logs for anomalous OOM or SIGABRT events as potential exploitation indicators.
What systems are affected by CVE-2022-41880?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, NLP model deployments, recommendation system pipelines.
What is the CVSS score for CVE-2022-41880?
CVE-2022-41880 has a CVSS v3.1 base score of 9.1 (CRITICAL). The EPSS exploitation probability is 0.15%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. When the `BaseCandidateSamplerOp` function receives a value in `true_classes` larger than `range_max`, a heap oob read occurs. We have patched the issue in GitHub commit b389f5c944cadfdfe599b3f1e4026e036f30d2d4. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.
Exploitation Scenario
An adversary targets an organization's TF Serving endpoint powering a recommendation API that uses sampled softmax training. By reviewing TensorFlow source code and the GHSA advisory, they identify that BaseCandidateSamplerOp performs no bounds check on true_classes against range_max. They craft a prediction request with a true_classes tensor value exceeding range_max, triggering a heap OOB read. Repeated controlled reads allow the adversary to probe adjacent heap memory, potentially leaking cached model weights, API keys loaded into the serving process, or fragments of other users' inference inputs. No credentials or prior access are required if the endpoint is publicly reachable.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H References
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