CVE-2022-23587: TensorFlow: integer overflow in Grappler enables RCE

CRITICAL PoC AVAILABLE CISA: ATTEND
Published February 4, 2022
CISO Take

Patch TensorFlow immediately to 2.8.0, 2.7.1, 2.6.3, or 2.5.3. This CVSS 9.8 flaw in the Grappler optimizer allows unauthenticated remote attackers to trigger undefined behavior via malicious crop/resize parameters—any TensorFlow serving endpoint accepting user-controlled image inputs is exposed. Audit all TensorFlow versions in your ML stack and treat this as a production-blocking upgrade.

Risk Assessment

Severity is maximum: CVSS 9.8 with no authentication, no user interaction, and network reachability. The integer overflow in Grappler's cost estimator for crop-and-resize is user-triggered, meaning any ML inference API or data pipeline that accepts image cropping parameters from external sources is exploitable without special privileges. Blast radius is broad—TensorFlow is the dominant ML framework, and many organizations run unpatched versions in production model serving. The undefined behavior outcome (potential RCE or crash) makes this unpredictable and dangerous.

Affected Systems

Package Ecosystem Vulnerable Range Patched
tensorflow pip No patch
195.0K OpenSSF 7.2 3.7K dependents Pushed today 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
9.8 / 10
EPSS
0.3%
chance of exploitation in 30 days
Higher than 53% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

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

Recommended Action

5 steps
  1. Upgrade TensorFlow to 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately—patches are available for all supported branches.

  2. Inventory all TensorFlow instances across ML infrastructure (training servers, serving clusters, notebooks, CI/CD pipelines).

  3. As interim workaround: validate and clamp crop box coordinates and aspect ratios at the API boundary before passing to TensorFlow ops.

  4. Enable runtime monitoring for abnormal crash patterns or OOM events in TF Serving processes.

  5. Apply least-privilege isolation to TF Serving containers to limit blast radius if exploited.

CISA SSVC Assessment

Decision Attend
Exploitation poc
Automatable No
Technical Impact total

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 9 - Risk management system
ISO 42001
6.1 - Actions to address risks and opportunities 8.1 - Operational planning and control
NIST AI RMF
MANAGE 2.2 - Mechanisms are in place to sustain the value of deployed AI systems
OWASP LLM Top 10
LLM05 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2022-23587?

Patch TensorFlow immediately to 2.8.0, 2.7.1, 2.6.3, or 2.5.3. This CVSS 9.8 flaw in the Grappler optimizer allows unauthenticated remote attackers to trigger undefined behavior via malicious crop/resize parameters—any TensorFlow serving endpoint accepting user-controlled image inputs is exposed. Audit all TensorFlow versions in your ML stack and treat this as a production-blocking upgrade.

Is CVE-2022-23587 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2022-23587, increasing the risk of exploitation.

How to fix CVE-2022-23587?

1. Upgrade TensorFlow to 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately—patches are available for all supported branches. 2. Inventory all TensorFlow instances across ML infrastructure (training servers, serving clusters, notebooks, CI/CD pipelines). 3. As interim workaround: validate and clamp crop box coordinates and aspect ratios at the API boundary before passing to TensorFlow ops. 4. Enable runtime monitoring for abnormal crash patterns or OOM events in TF Serving processes. 5. Apply least-privilege isolation to TF Serving containers to limit blast radius if exploited.

What systems are affected by CVE-2022-23587?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference APIs, computer vision pipelines, ML preprocessing pipelines.

What is the CVSS score for CVE-2022-23587?

CVE-2022-23587 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.29%.

Technical Details

NVD Description

Tensorflow is an Open Source Machine Learning Framework. Under certain scenarios, Grappler component of TensorFlow is vulnerable to an integer overflow during cost estimation for crop and resize. Since the cropping parameters are user controlled, a malicious person can trigger undefined behavior. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Exploitation Scenario

An adversary targets an image processing microservice backed by TensorFlow (e.g., a product photo classifier or medical scan analyzer). They craft a request with extreme or mathematically adversarial crop box values—coordinates near integer boundaries—that trigger overflow in Grappler's op_level_cost_estimator during graph optimization. The resulting undefined behavior causes memory corruption, enabling potential arbitrary code execution within the TF Serving process. With CVSS PR:N/UI:N, this requires no account or user interaction—just a crafted HTTP payload to the inference endpoint.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
February 4, 2022
Last Modified
November 21, 2024
First Seen
February 4, 2022

Related Vulnerabilities