CVE-2022-21741: TensorFlow Lite: DoS via crafted depthwise conv model
MEDIUM PoC AVAILABLETFLite inference processes that accept externally-supplied model files can be crashed by a malicious model exploiting a division-by-zero in the depthwise convolution kernel — no code execution, pure availability impact. For any service accepting user-supplied TFLite models or exposing TFLite inference as an API, this is a trivial DoS with low-privilege access requirements. Patch to TensorFlow 2.8.0+ (or 2.7.1/2.6.3/2.5.3 cherrypicks) and restrict model sources to trusted, signed artifacts.
Risk Assessment
Medium risk overall, aligned with CVSS 6.5. No confidentiality or integrity impact, but the attack requires only network access and low privileges with no user interaction — making it operationally simple to execute repeatedly. The blast radius is limited to availability of the TFLite inference process. Not in CISA KEV and no active exploitation reported, but edge and mobile AI deployments with public-facing inference APIs warrant prompt patching given exploit simplicity.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch immediately: Upgrade to TensorFlow 2.8.0+, or apply vendor cherrypicks to 2.7.1, 2.6.3, or 2.5.3.
-
Restrict model sources: Only load TFLite models from trusted, cryptographically signed sources; reject user-supplied model files in production APIs.
-
Pre-load validation: Add a model validation step that checks convolution parameters are strictly positive before invoking the runtime.
-
Process isolation: Run TFLite inference in sandboxed worker processes so a crash does not cascade to the parent service.
-
Monitor: Alert on repeated inference process crashes or SIGFPE signals; rate-limit model submission endpoints.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-21741?
TFLite inference processes that accept externally-supplied model files can be crashed by a malicious model exploiting a division-by-zero in the depthwise convolution kernel — no code execution, pure availability impact. For any service accepting user-supplied TFLite models or exposing TFLite inference as an API, this is a trivial DoS with low-privilege access requirements. Patch to TensorFlow 2.8.0+ (or 2.7.1/2.6.3/2.5.3 cherrypicks) and restrict model sources to trusted, signed artifacts.
Is CVE-2022-21741 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-21741, increasing the risk of exploitation.
How to fix CVE-2022-21741?
1. Patch immediately: Upgrade to TensorFlow 2.8.0+, or apply vendor cherrypicks to 2.7.1, 2.6.3, or 2.5.3. 2. Restrict model sources: Only load TFLite models from trusted, cryptographically signed sources; reject user-supplied model files in production APIs. 3. Pre-load validation: Add a model validation step that checks convolution parameters are strictly positive before invoking the runtime. 4. Process isolation: Run TFLite inference in sandboxed worker processes so a crash does not cascade to the parent service. 5. Monitor: Alert on repeated inference process crashes or SIGFPE signals; rate-limit model submission endpoints.
What systems are affected by CVE-2022-21741?
This vulnerability affects the following AI/ML architecture patterns: edge inference (TFLite), model serving, mobile AI pipelines, embedded AI systems.
What is the CVSS score for CVE-2022-21741?
CVE-2022-21741 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 0.23%.
Technical Details
NVD Description
Tensorflow is an Open Source Machine Learning Framework. ### Impact An attacker can craft a TFLite model that would trigger a division by zero in the implementation of depthwise convolutions. The parameters of the convolution can be user controlled and are also used within a division operation to determine the size of the padding that needs to be added before applying the convolution. There is no check before this division that the divisor is strictly positive. 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 targeting an organization's edge AI inference API — for example, an image classification service powered by TFLite — crafts a malicious .tflite model with depthwise convolution parameters set to zero. Submitting this model to the inference endpoint (requiring only a low-privilege API key) triggers a division-by-zero in the depthwise convolution padding computation, crashing the inference worker. Repeated submissions constitute a trivial, sustained DoS against the ML service. No specialized ML knowledge is required beyond basic understanding of the TFLite flatbuffer model format, placing this firmly in script-kiddie territory.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/lite/kernels/depthwise_conv.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/e5b0eec199c2d03de54fd6a7fd9275692218e2bc Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-428x-9xc2-m8mj Patch 3rd Party
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