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.

Risk Assessment

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.

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.3%
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, 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

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.

CISA SSVC Assessment

Decision Attend
Exploitation poc
Automatable No
Technical Impact total

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

Technical Details

NVD Description

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)

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