CVE-2022-41886: TensorFlow: integer overflow in image op causes DoS
HIGH PoC AVAILABLE CISA: TRACK*This vulnerability allows unauthenticated remote attackers to crash TensorFlow-based inference services by sending a crafted request with an oversized output shape parameter. Any externally-exposed TF image processing endpoint is a direct DoS target with no prerequisites. Patch immediately to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4, and add input validation at your API boundary for shape parameters.
What is the risk?
High severity (CVSS 7.5) with low exploitability barrier: network-accessible, no authentication, no user interaction. The impact is limited to availability (no data exfiltration risk), but in production ML serving environments a persistent crash loop or repeated triggering can result in sustained service outage. Risk is elevated for computer vision APIs that accept user-controlled image transformation parameters.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
PATCH
Upgrade to TensorFlow 2.11, or cherrypick commit 8faa6ea692985dbe6ce10e1a3168e0bd60a723ba into 2.10.1, 2.9.3, or 2.8.4.
-
VALIDATE
Add server-side bounds checking on output_shape parameters before passing to image ops — reject requests where product of dimensions exceeds a safe threshold (e.g., 4096x4096).
-
ISOLATE
Run TF serving workers in containers with auto-restart policies; consider per-request resource limits to contain blast radius.
-
MONITOR
Alert on abnormal TF worker crash rates as an indicator of exploitation attempts.
-
AUDIT
Inventory all internal services using
ImageProjectiveTransformV2or related projection ops.
What does CISA's SSVC say?
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:
Frequently Asked Questions
What is CVE-2022-41886?
This vulnerability allows unauthenticated remote attackers to crash TensorFlow-based inference services by sending a crafted request with an oversized output shape parameter. Any externally-exposed TF image processing endpoint is a direct DoS target with no prerequisites. Patch immediately to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4, and add input validation at your API boundary for shape parameters.
Is CVE-2022-41886 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-41886, increasing the risk of exploitation.
How to fix CVE-2022-41886?
1. PATCH: Upgrade to TensorFlow 2.11, or cherrypick commit 8faa6ea692985dbe6ce10e1a3168e0bd60a723ba into 2.10.1, 2.9.3, or 2.8.4. 2. VALIDATE: Add server-side bounds checking on output_shape parameters before passing to image ops — reject requests where product of dimensions exceeds a safe threshold (e.g., 4096x4096). 3. ISOLATE: Run TF serving workers in containers with auto-restart policies; consider per-request resource limits to contain blast radius. 4. MONITOR: Alert on abnormal TF worker crash rates as an indicator of exploitation attempts. 5. AUDIT: Inventory all internal services using `ImageProjectiveTransformV2` or related projection ops.
What systems are affected by CVE-2022-41886?
This vulnerability affects the following AI/ML architecture patterns: model serving, inference APIs, computer vision pipelines, training pipelines, data augmentation pipelines.
What is the CVSS score for CVE-2022-41886?
CVE-2022-41886 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.43%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0029 Denial of AI Service AML.T0034 Cost Harvesting AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
TensorFlow is an open source platform for machine learning. When `tf.raw_ops.ImageProjectiveTransformV2` is given a large output shape, it overflows. We have patched the issue in GitHub commit 8faa6ea692985dbe6ce10e1a3168e0bd60a723ba. 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 identifies a public-facing image processing API backed by TensorFlow (e.g., a document digitization service, face recognition endpoint, or visual search). They send a crafted POST request with a valid image but specify an extremely large `output_shape` (e.g., [INT_MAX, INT_MAX]) in the transformation parameters. TensorFlow's buffer size calculation overflows, triggering a crash in the serving worker. The attacker repeats this in a loop at low rate to maintain continuous service degradation while evading rate-limit thresholds. In Kubernetes environments without proper liveness probe tuning, this can cause cascading restarts affecting the entire inference tier.
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 References
- github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/image/image_ops.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/8faa6ea692985dbe6ce10e1a3168e0bd60a723ba Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-54pp-c6pp-7fpx Exploit Patch 3rd Party
- github.com/gclonly/im Exploit
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