CVE-2022-23558: TFLite: integer overflow in model loading, RCE risk
HIGH PoC AVAILABLE CISA: TRACK*Any application that loads TFLite models from untrusted sources (user uploads, third-party model repos, edge deployments) is exposed to memory corruption leading to full system compromise. Patch immediately to TF 2.8.0/2.7.1/2.6.3/2.5.3 and enforce strict model provenance controls. If patching is not immediate, block untrusted model ingestion at the application layer.
Risk Assessment
High risk (CVSS 8.8). Low attack complexity and low privilege requirement make this practical to exploit — an authenticated user who can supply a model file can trigger the overflow. Network-accessible inference endpoints that accept model uploads are the primary exposure surface. No CISA KEV listing but the public exploit PoC in the advisory lowers the bar significantly. Edge/mobile deployments running unpatched TFLite are permanently exposed until firmware or app updates are pushed.
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: Upgrade TensorFlow to 2.8.0, or cherry-pick to 2.7.1, 2.6.3, or 2.5.3 as applicable.
-
Model provenance: Only load TFLite models from cryptographically signed, internal sources — never from user input directly.
-
Input validation: Validate model tensor dimensions before deserialization; reject models with abnormally large dimension values.
-
Sandboxing: Run TFLite inference in isolated processes or containers with restricted permissions (seccomp, AppArmor) to limit blast radius.
-
Detection: Alert on crashes or OOM errors in inference workers loading external models — these may indicate exploitation attempts.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-23558?
Any application that loads TFLite models from untrusted sources (user uploads, third-party model repos, edge deployments) is exposed to memory corruption leading to full system compromise. Patch immediately to TF 2.8.0/2.7.1/2.6.3/2.5.3 and enforce strict model provenance controls. If patching is not immediate, block untrusted model ingestion at the application layer.
Is CVE-2022-23558 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23558, increasing the risk of exploitation.
How to fix CVE-2022-23558?
1. Patch: Upgrade TensorFlow to 2.8.0, or cherry-pick to 2.7.1, 2.6.3, or 2.5.3 as applicable. 2. Model provenance: Only load TFLite models from cryptographically signed, internal sources — never from user input directly. 3. Input validation: Validate model tensor dimensions before deserialization; reject models with abnormally large dimension values. 4. Sandboxing: Run TFLite inference in isolated processes or containers with restricted permissions (seccomp, AppArmor) to limit blast radius. 5. Detection: Alert on crashes or OOM errors in inference workers loading external models — these may indicate exploitation attempts.
What systems are affected by CVE-2022-23558?
This vulnerability affects the following AI/ML architecture patterns: model serving, edge/mobile inference, training pipelines, model evaluation pipelines.
What is the CVSS score for CVE-2022-23558?
CVE-2022-23558 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.39%.
Technical Details
NVD Description
Tensorflow is an Open Source Machine Learning Framework. An attacker can craft a TFLite model that would cause an integer overflow in `TfLiteIntArrayCreate`. The `TfLiteIntArrayGetSizeInBytes` returns an `int` instead of a `size_t. An attacker can control model inputs such that `computed_size` overflows the size of `int` datatype. 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 targets a cloud-based model serving platform that allows tenants to upload custom TFLite models for inference. The attacker crafts a malicious .tflite flatbuffer file with tensor shape values engineered so that the size computation overflows the int type, causing TfLiteIntArrayCreate to allocate a buffer smaller than required. When the platform loads the model for inference, the runtime writes beyond the buffer boundary, corrupting heap metadata. The attacker achieves arbitrary code execution in the inference worker process, potentially pivoting to exfiltrate other tenants' model weights, training data, or credentials stored in the environment.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H References
- github.com/tensorflow/tensorflow/blob/ca6f96b62ad84207fbec580404eaa7dd7403a550/tensorflow/lite/c/common.c Exploit 3rd Party
- github.com/tensorflow/tensorflow/blob/ca6f96b62ad84207fbec580404eaa7dd7403a550/tensorflow/lite/c/common.c Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/a1e1511dde36b3f8aa27a6ec630838e7ea40e091 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-9gwq-6cwj-47h3 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