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.

What is the risk?

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.

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
9.8 / 10
EPSS
0.9%
chance of exploitation in 30 days
Higher than 54% 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, 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 High
I High
A High

What should I do?

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.

What does CISA's SSVC say?

Decision Attend
Exploitation poc
Automatable No
Technical Impact total

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
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.87%.

What is the AI security impact?

Affected AI Architectures

model servingtraining pipelinesinference APIscomputer vision pipelinesML preprocessing pipelines

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0043 Craft Adversarial Data
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 9
ISO 42001: 6.1, 8.1
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM05

What are the technical details?

Original Advisory

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.

Weaknesses (CWE)

CWE-190 — Integer Overflow or Wraparound: The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.

  • [Requirements] Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
  • [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. If possible, choose a language or compiler that performs automatic bounds checking.

Source: MITRE CWE corpus.

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