CVE-2022-41895: TensorFlow: heap OOB in MirrorPadGrad causes DoS

HIGH PoC AVAILABLE
Published November 18, 2022
CISO Take

Any TensorFlow deployment exposing image processing or gradient computation to untrusted input is at risk of unauthenticated remote crash. The attack requires no privileges and no user interaction — a single malformed request can take down an inference or training service. Patch to TF 2.11, 2.10.1, 2.9.3, or 2.8.4 immediately; if patching is delayed, add input validation and rate-limiting on all TF serving endpoints.

Risk Assessment

High severity (CVSS 7.5) with a narrow but real blast radius. The availability-only impact (C:N/I:N/A:H) limits business risk to service disruption rather than data breach. However, the AV:N/AC:L/PR:N/UI:N vector means any internet-exposed TensorFlow Serving instance is exploitable by script-kiddies. Risk elevates significantly for production ML inference APIs handling image-related tasks, as a DoS attack could blind downstream detection or classification systems that security tooling depends on.

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
7.5 / 10
EPSS
0.1%
chance of exploitation in 30 days
Higher than 34% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
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 None
I None
A High

Recommended Action

6 steps
  1. Patch: Upgrade to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4 (commit 717ca98d8c3bba348ff62281fdf38dcb5ea1ec92).

  2. Input validation: Enforce strict bounds on paddings tensor dimensions at the API gateway or application layer before passing to TF ops.

  3. Process isolation: Run TF serving in sandboxed containers with memory limits so a crash does not cascade.

  4. Rate limiting: Apply per-client rate limits on inference endpoints to reduce DoS amplification.

  5. Detection: Monitor for TF process crashes or OOM-killer events; alert on abnormal tensor size inputs in request logs.

  6. Inventory: Identify all internal services linking TF image processing ops to externally controlled input.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity of high-risk AI systems
ISO 42001
A.6.2.6 - Security of AI system components A.9.2 - Availability of AI systems
NIST AI RMF
GOVERN 4.2 - Organizational policies for AI risk MANAGE 2.2 - Mechanisms to achieve AI risk management objectives

Frequently Asked Questions

What is CVE-2022-41895?

Any TensorFlow deployment exposing image processing or gradient computation to untrusted input is at risk of unauthenticated remote crash. The attack requires no privileges and no user interaction — a single malformed request can take down an inference or training service. Patch to TF 2.11, 2.10.1, 2.9.3, or 2.8.4 immediately; if patching is delayed, add input validation and rate-limiting on all TF serving endpoints.

Is CVE-2022-41895 actively exploited?

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

How to fix CVE-2022-41895?

1. Patch: Upgrade to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4 (commit 717ca98d8c3bba348ff62281fdf38dcb5ea1ec92). 2. Input validation: Enforce strict bounds on paddings tensor dimensions at the API gateway or application layer before passing to TF ops. 3. Process isolation: Run TF serving in sandboxed containers with memory limits so a crash does not cascade. 4. Rate limiting: Apply per-client rate limits on inference endpoints to reduce DoS amplification. 5. Detection: Monitor for TF process crashes or OOM-killer events; alert on abnormal tensor size inputs in request logs. 6. Inventory: Identify all internal services linking TF image processing ops to externally controlled input.

What systems are affected by CVE-2022-41895?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference endpoints, image processing pipelines.

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

CVE-2022-41895 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.14%.

Technical Details

NVD Description

TensorFlow is an open source platform for machine learning. If `MirrorPadGrad` is given outsize input `paddings`, TensorFlow will give a heap OOB error. We have patched the issue in GitHub commit 717ca98d8c3bba348ff62281fdf38dcb5ea1ec92. 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 targeting a computer vision API (e.g., a fraud detection image classifier or an AI-powered content moderation service) crafts a POST request with an oversized paddings tensor to the TF Serving gRPC or REST endpoint. The MirrorPadGrad kernel reads beyond allocated heap memory, triggering a process crash. The attacker repeats this at intervals to maintain a persistent DoS against the inference service, effectively blinding any downstream security or operational system that depends on real-time image classification. No ML knowledge is required — only knowledge that the target uses TensorFlow and processes padded image tensors.

Weaknesses (CWE)

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