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.

What is the risk?

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.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 3d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
8.8 / 10
EPSS
0.8%
chance of exploitation in 30 days
Higher than 52% 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, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the 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

What should I do?

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.

What does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

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:

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.80%.

What is the AI security impact?

Affected AI Architectures

model servingedge/mobile inferencetraining pipelinesmodel evaluation pipelines

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0011.000 Unsafe AI Artifacts
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Art.15
ISO 42001: A.6.2.6
NIST AI RMF: MS-2.5
OWASP LLM Top 10: LLM05

What are the technical details?

Original Advisory

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)

CWE-190 — Integer Overflow or Wraparound: The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.

  • [Requirements] Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
  • [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. If possible, choose a language or compiler that performs automatic bounds checking.

Source: MITRE CWE corpus.

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