CVE-2022-41895: TensorFlow: heap OOB in MirrorPadGrad causes DoS
HIGH PoC AVAILABLEAny 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 |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
Patch: Upgrade to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4 (commit 717ca98d8c3bba348ff62281fdf38dcb5ea1ec92).
-
Input validation: Enforce strict bounds on paddings tensor dimensions at the API gateway or application layer before passing to TF ops.
-
Process isolation: Run TF serving in sandboxed containers with memory limits so a crash does not cascade.
-
Rate limiting: Apply per-client rate limits on inference endpoints to reduce DoS amplification.
-
Detection: Monitor for TF process crashes or OOM-killer events; alert on abnormal tensor size inputs in request logs.
-
Inventory: Identify all internal services linking TF image processing ops to externally controlled input.
Classification
Compliance Impact
This CVE is relevant to:
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 References
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
AI Threat Alert