CVE-2022-23558: TFLite: integer overflow in model loading, RCE risk

HIGH PoC AVAILABLE CISA: TRACK*
Published February 4, 2022
CISO Take

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
195.0K OpenSSF 7.2 3.7K dependents Pushed today 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
8.8 / 10
EPSS
0.4%
chance of exploitation in 30 days
Higher than 60% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR Low
UI None
S Unchanged
C High
I High
A High

Recommended Action

5 steps
  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.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Art.15 - Accuracy, robustness and cybersecurity (High-risk AI)
ISO 42001
A.6.2.6 - AI system robustness and security testing
NIST AI RMF
MS-2.5 - AI system testing against attacks and failures
OWASP LLM Top 10
LLM05 - Supply Chain Vulnerabilities

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

Timeline

Published
February 4, 2022
Last Modified
November 21, 2024
First Seen
February 4, 2022

Related Vulnerabilities