CVE-2022-41907: TensorFlow: integer overflow in ResizeNearestNeighborGrad → DoS
HIGH PoC AVAILABLE CISA: TRACK*An unauthenticated remote attacker can crash any TensorFlow inference service by sending a crafted image resize request with an oversized `size` parameter, triggering an integer overflow. If your ML serving infrastructure exposes TensorFlow endpoints publicly or accepts untrusted input, this is an availability risk requiring immediate patching. Upgrade to TF 2.11, 2.10.1, 2.9.3, or 2.8.4 — no workaround exists short of input validation at the API boundary.
What is the risk?
High severity for publicly exposed TF serving endpoints due to network-exploitable, zero-auth, zero-interaction exploit path (CVSS 7.5). Impact is limited to availability — no data exfiltration or integrity compromise. Risk is elevated in production computer vision APIs where arbitrary image dimensions are accepted. Reduced risk for air-gapped training environments or pipelines with strict input schema validation. Not in CISA KEV and no evidence of active exploitation, keeping effective risk at MEDIUM-HIGH for most organizations.
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 TensorFlow to 2.11.0+, 2.10.1+, 2.9.3+, or 2.8.4+ (commit 00c821af).
-
VALIDATE
Enforce strict input validation on image dimensions at API boundaries — reject or clamp
sizevalues above a safe maximum before reaching TF ops. -
ISOLATE
Run TF Serving behind an API gateway with request schema validation (e.g., max height/width constraints).
-
DETECT
Monitor for sudden process crashes or OOM kills in TF serving processes — repeated crashes from a single source may indicate exploitation attempts.
-
VERIFY
Check
pip show tensorflowin all serving environments; scan Dockerfiles and requirements.txt for pinned pre-patch versions.
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-41907?
An unauthenticated remote attacker can crash any TensorFlow inference service by sending a crafted image resize request with an oversized `size` parameter, triggering an integer overflow. If your ML serving infrastructure exposes TensorFlow endpoints publicly or accepts untrusted input, this is an availability risk requiring immediate patching. Upgrade to TF 2.11, 2.10.1, 2.9.3, or 2.8.4 — no workaround exists short of input validation at the API boundary.
Is CVE-2022-41907 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-41907, increasing the risk of exploitation.
How to fix CVE-2022-41907?
1. PATCH: Upgrade TensorFlow to 2.11.0+, 2.10.1+, 2.9.3+, or 2.8.4+ (commit 00c821af). 2. VALIDATE: Enforce strict input validation on image dimensions at API boundaries — reject or clamp `size` values above a safe maximum before reaching TF ops. 3. ISOLATE: Run TF Serving behind an API gateway with request schema validation (e.g., max height/width constraints). 4. DETECT: Monitor for sudden process crashes or OOM kills in TF serving processes — repeated crashes from a single source may indicate exploitation attempts. 5. VERIFY: Check `pip show tensorflow` in all serving environments; scan Dockerfiles and requirements.txt for pinned pre-patch versions.
What systems are affected by CVE-2022-41907?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, computer vision pipelines.
What is the CVSS score for CVE-2022-41907?
CVE-2022-41907 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.44%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service 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.ResizeNearestNeighborGrad` is given a large `size` input, it overflows. We have patched the issue in GitHub commit 00c821af032ba9e5f5fa3fe14690c8d28a657624. 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., an image classification or object detection endpoint) sends a crafted inference request containing an image with an extreme `size` parameter to trigger the `ResizeNearestNeighborGrad` operation. The integer overflow occurs server-side, causing the TF runtime to crash. This requires no credentials, no special AI/ML knowledge, and no prior access — only the ability to send a network request. Automated scanners could discover exposed TF Serving endpoints (default port 8501) and exploit this at scale to degrade availability of AI-powered services.
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/resize_nearest_neighbor_op.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/00c821af032ba9e5f5fa3fe14690c8d28a657624 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-368v-7v32-52fx 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