CVE-2022-23560: TFLite: OOB read/write in sparse tensor → RCE

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

Any service that loads untrusted TFLite model files is exposed to memory corruption enabling code execution or data disclosure. Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. Audit all inference pipelines that accept externally-sourced TFLite models and enforce strict model provenance controls.

What is the risk?

CVSS 8.8 with network vector, low complexity, and no user interaction required represents a high-severity threat to any TFLite deployment processing third-party model files. The dual CWE-125/787 combination (OOB read + write) creates a realistic code execution path. Not in CISA KEV, but the low exploitation barrier and widespread TFLite adoption in production inference services elevates practical risk above the score alone.

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 53% 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?

6 steps
  1. Patch immediately: upgrade to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3.

  2. Model provenance: enforce allow-listing — only load cryptographically signed models from trusted internal registries; reject all externally-sourced TFLite files.

  3. Process isolation: run TFLite inference in sandboxed processes or containers with minimal privileges and seccomp profiles to limit blast radius.

  4. Input validation: add pre-load validation layer that inspects TFLite flatbuffer metadata for malformed sparse tensor fields before passing to runtime.

  5. Detection: alert on inference process crashes, unexpected memory spikes, or OOM kills in inference workers — these are exploitation indicators.

  6. Inventory: audit all internal services consuming TFLite models, including CI/CD pipelines that run model validation.

What does CISA's SSVC say?

Decision Attend
Exploitation poc
Automatable No
Technical Impact total

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
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2 - AI system risk management
NIST AI RMF
MS-2.5 - AI risks and trustworthiness are prioritized and managed
OWASP LLM Top 10
LLM05:2025 - Insecure Output Handling / Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2022-23560?

Any service that loads untrusted TFLite model files is exposed to memory corruption enabling code execution or data disclosure. Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. Audit all inference pipelines that accept externally-sourced TFLite models and enforce strict model provenance controls.

Is CVE-2022-23560 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2022-23560, increasing the risk of exploitation.

How to fix CVE-2022-23560?

1. Patch immediately: upgrade to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3. 2. Model provenance: enforce allow-listing — only load cryptographically signed models from trusted internal registries; reject all externally-sourced TFLite files. 3. Process isolation: run TFLite inference in sandboxed processes or containers with minimal privileges and seccomp profiles to limit blast radius. 4. Input validation: add pre-load validation layer that inspects TFLite flatbuffer metadata for malformed sparse tensor fields before passing to runtime. 5. Detection: alert on inference process crashes, unexpected memory spikes, or OOM kills in inference workers — these are exploitation indicators. 6. Inventory: audit all internal services consuming TFLite models, including CI/CD pipelines that run model validation.

What systems are affected by CVE-2022-23560?

This vulnerability affects the following AI/ML architecture patterns: On-device inference (mobile/edge TFLite deployments), Model serving endpoints, Third-party model import workflows, Training-to-deployment pipelines, IoT AI applications.

What is the CVSS score for CVE-2022-23560?

CVE-2022-23560 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.82%.

What is the AI security impact?

Affected AI Architectures

On-device inference (mobile/edge TFLite deployments)Model serving endpointsThird-party model import workflowsTraining-to-deployment pipelinesIoT AI applications

MITRE ATLAS Techniques

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

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2
NIST AI RMF: MS-2.5
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

Tensorflow is an Open Source Machine Learning Framework. An attacker can craft a TFLite model that would allow limited reads and writes outside of arrays in TFLite. This exploits missing validation in the conversion from sparse tensors to dense tensors. The fix is 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. Users are advised to upgrade as soon as possible.

Exploitation Scenario

An attacker uploads a specially crafted TFLite model file to a public model inference API or a compromised model registry. The model contains malformed sparse tensor metadata in the sparsity_format_converter path — specifically, dimension values that pass initial checks but cause pointer arithmetic to exceed allocated buffer bounds at lines 252-293 of the converter. When the serving backend loads the model for inference, the runtime performs OOB reads (leaking heap contents including adjacent tensor data or in-memory secrets) and OOB writes (corrupting heap control structures). On a successful write primitive, the attacker achieves code execution within the inference server process, gaining access to the host system, co-tenant model weights, and any secrets mounted in the inference environment.

Weaknesses (CWE)

CWE-125 — Out-of-bounds Read: The product reads data past the end, or before the beginning, of the intended buffer.

  • [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
  • [Architecture and Design] Use a language that provides appropriate memory abstractions.

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