CVE-2022-41887: TensorFlow: int32 overflow crashes Poisson loss function
HIGH PoC AVAILABLE CISA: TRACK*Any TensorFlow deployment using Poisson loss in training or inference is remotely crashable with zero authentication and no ML expertise required—just a malformed tensor. Upgrade immediately to TF 2.11, 2.10.1, or 2.9.3; TF 2.8.x will not receive a backport. If patching is delayed, enforce hard tensor dimension limits at the API boundary before inputs reach the loss computation.
What is the risk?
High severity DoS (CVSS 7.5, AV:N/AC:L/PR:N/UI:N). Trivially exploitable over the network with no privileges, making every exposed TF endpoint a viable target. Impact is limited to availability—no data exfiltration or code execution—but in production ML pipelines a repeated crash aborts training runs, risks checkpoint corruption, and violates SLAs. Not in CISA KEV and no confirmed active exploitation as of enrichment, but the attack surface is broad given TF's ubiquity in enterprise AI stacks.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Patch: upgrade to TensorFlow 2.11, 2.10.1, or 2.9.3 (commit c5b30379).
-
Input validation: reject inference requests where the product of tensor dimensions exceeds INT32_MAX before reaching any Keras loss function.
-
Serving hardening: enforce maximum tensor shape limits in TF Serving, gRPC preprocessing, or API gateway middleware—framework-level memory limits alone do not block this path.
-
Audit: inventory Docker/conda environments pinned to 2.9.x or 2.10.x without the patch applied.
-
Detection: alert on abnormal TF process crashes or out-of-range tensor dimension values in inference request logs.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-41887?
Any TensorFlow deployment using Poisson loss in training or inference is remotely crashable with zero authentication and no ML expertise required—just a malformed tensor. Upgrade immediately to TF 2.11, 2.10.1, or 2.9.3; TF 2.8.x will not receive a backport. If patching is delayed, enforce hard tensor dimension limits at the API boundary before inputs reach the loss computation.
Is CVE-2022-41887 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-41887, increasing the risk of exploitation.
How to fix CVE-2022-41887?
1. Patch: upgrade to TensorFlow 2.11, 2.10.1, or 2.9.3 (commit c5b30379). 2. Input validation: reject inference requests where the product of tensor dimensions exceeds INT32_MAX before reaching any Keras loss function. 3. Serving hardening: enforce maximum tensor shape limits in TF Serving, gRPC preprocessing, or API gateway middleware—framework-level memory limits alone do not block this path. 4. Audit: inventory Docker/conda environments pinned to 2.9.x or 2.10.x without the patch applied. 5. Detection: alert on abnormal TF process crashes or out-of-range tensor dimension values in inference request logs.
What systems are affected by CVE-2022-41887?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference endpoints.
What is the CVSS score for CVE-2022-41887?
CVE-2022-41887 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.44%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0029 Denial of AI Service AML.T0034 Cost Harvesting AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
TensorFlow is an open source platform for machine learning. `tf.keras.losses.poisson` receives a `y_pred` and `y_true` that are passed through `functor::mul` in `BinaryOp`. If the resulting dimensions overflow an `int32`, TensorFlow will crash due to a size mismatch during broadcast assignment. We have patched the issue in GitHub commit c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1 and 2.9.3, as these are also affected and still in supported range. However, we will not cherrypick this commit into TensorFlow 2.8.x, as it depends on Eigen behavior that changed between 2.8 and 2.9.
Exploitation Scenario
An adversary identifies a TensorFlow-backed model serving endpoint (via API docs, error response headers, or passive fingerprinting). They craft a gRPC or REST inference request containing `y_pred`/`y_true` tensors with shape dimensions whose broadcast product exceeds 2^31-1. When the Poisson loss function attempts to compute the BinaryOp multiplication, the int32 overflow triggers a fatal size mismatch and crashes the TF serving process. Repeated requests prevent process recovery, achieving a persistent DoS. No authentication token, prior access, or ML knowledge is required—the only prerequisite is knowing the endpoint exists.
Weaknesses (CWE)
CWE-131 — Incorrect Calculation of Buffer Size: The product does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow.
- [Implementation] When allocating a buffer for the purpose of transforming, converting, or encoding an input, allocate enough memory to handle the largest possible encoding. For example, in a routine that converts "&" characters to "&" for HTML entity encoding, the output buffer needs to be at least 5 times as large as the input buffer.
- [Implementation] Understand the programming language's underlying representation and how it interacts with numeric calculation (CWE-681). Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, "not-a-number" calculations, and how the language handles numbers that are too large or too small for its underlying representation. [REF-7] Also be careful to account for 32-bit, 64-bit, and other potential differences that may affect the numeric representation.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/cwise_ops_common.h 3rd Party
- github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/losses.py 3rd Party
- github.com/tensorflow/tensorflow/commit/c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-8fvv-46hw-vpg3 Exploit Patch 3rd Party
- github.com/ARPSyndicate/cvemon 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