CVE-2022-41887: TensorFlow: int32 overflow crashes Poisson loss function

HIGH PoC AVAILABLE CISA: TRACK*
Published November 18, 2022
CISO Take

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
195.8K OpenSSF 7.1 3.7K dependents Pushed 3d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
7.5 / 10
EPSS
0.4%
chance of exploitation in 30 days
Higher than 35% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C None
I None
A High

What should I do?

5 steps
  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 does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

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:

EU AI Act
Art.15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6 - AI system robustness and availability
NIST AI RMF
RES-1.1 - Resilience
OWASP LLM Top 10
LLM10:2025 - Unbounded Consumption

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

model servingtraining pipelinesinference endpoints

MITRE ATLAS Techniques

AML.T0029 Denial of AI Service
AML.T0034 Cost Harvesting
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Art.15
ISO 42001: A.6.2.6
NIST AI RMF: RES-1.1
OWASP LLM Top 10: LLM10:2025

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

Timeline

Published
November 18, 2022
Last Modified
November 21, 2024
First Seen
November 18, 2022

Related Vulnerabilities