CVE-2022-23560: TFLite: OOB read/write in sparse tensor → RCE
HIGH PoC AVAILABLE CISA: ATTENDAny 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 |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
Patch immediately: upgrade to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3.
-
Model provenance: enforce allow-listing — only load cryptographically signed models from trusted internal registries; reject all externally-sourced TFLite files.
-
Process isolation: run TFLite inference in sandboxed processes or containers with minimal privileges and seccomp profiles to limit blast radius.
-
Input validation: add pre-load validation layer that inspects TFLite flatbuffer metadata for malformed sparse tensor fields before passing to runtime.
-
Detection: alert on inference process crashes, unexpected memory spikes, or OOM kills in inference workers — these are exploitation indicators.
-
Inventory: audit all internal services consuming TFLite models, including CI/CD pipelines that run model validation.
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-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.
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/kernels/internal/utils/sparsity_format_converter.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/6364463d6f5b6254cac3d6aedf999b6a96225038 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-4hvf-hxvg-f67v 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