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.
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 |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
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.
What does CISA's SSVC say?
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:
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
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
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 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