CVE-2022-23581: TensorFlow: DoS via Grappler optimizer CHECK failure
MEDIUMPoC AVAILABLECISA: TRACK*Any TensorFlow deployment that loads SavedModels from untrusted or external sources is vulnerable to a process crash via crafted model files. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately if you run model-serving endpoints or automated training pipelines that ingest third-party models. Sandboxing model loading is a viable workaround if patching is delayed.
What is the risk?
Moderate operational risk despite medium CVSS score. The low attack complexity and network accessibility make this reliably exploitable by any authenticated user who can submit a SavedModel. Impact is limited to availability (no data exposure), but model-serving downtime in production AI systems can have significant business consequences. Risk escalates for multi-tenant ML platforms where users can upload arbitrary models.
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?
5 stepsPATCH
Upgrade to TensorFlow 2.8.0, or apply backport patches for 2.7.1, 2.6.3, or 2.5.3 (commits 1fb2773, 240655511, ebc1a2f).
RESTRICT
Enforce allowlists for SavedModel sources; reject externally-sourced models not originating from your own registry.
ISOLATE
Run model loading in sandboxed processes or containers so a crash does not take down the entire serving infrastructure.
DETECT
Monitor for abrupt TF process crashes, particularly in serving layers; alert on repeated CHECK assertion failures in logs (look for 'IsSimplifiableReshape' in stack traces).
VALIDATE
Implement pre-load model scanning as a pipeline gate before any SavedModel reaches a production optimizer.
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-23581?
Any TensorFlow deployment that loads SavedModels from untrusted or external sources is vulnerable to a process crash via crafted model files. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately if you run model-serving endpoints or automated training pipelines that ingest third-party models. Sandboxing model loading is a viable workaround if patching is delayed.
Is CVE-2022-23581 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23581, increasing the risk of exploitation.
How to fix CVE-2022-23581?
1. PATCH: Upgrade to TensorFlow 2.8.0, or apply backport patches for 2.7.1, 2.6.3, or 2.5.3 (commits 1fb2773, 240655511, ebc1a2f). 2. RESTRICT: Enforce allowlists for SavedModel sources; reject externally-sourced models not originating from your own registry. 3. ISOLATE: Run model loading in sandboxed processes or containers so a crash does not take down the entire serving infrastructure. 4. DETECT: Monitor for abrupt TF process crashes, particularly in serving layers; alert on repeated CHECK assertion failures in logs (look for 'IsSimplifiableReshape' in stack traces). 5. VALIDATE: Implement pre-load model scanning as a pipeline gate before any SavedModel reaches a production optimizer.
What systems are affected by CVE-2022-23581?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, ML inference endpoints, model registries, CI/CD model validation pipelines.
What is the CVSS score for CVE-2022-23581?
CVE-2022-23581 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 1.16%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001AI SoftwareAML.T0011.000Unsafe AI ArtifactsAML.T0029Denial of AI ServiceAML.T0049Exploit Public-Facing ApplicationCompliance Controls Affected
What are the technical details?
Original Advisory
Tensorflow is an Open Source Machine Learning Framework. The Grappler optimizer in TensorFlow can be used to cause a denial of service by altering a `SavedModel` such that `IsSimplifiableReshape` would trigger `CHECK` failures. 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 with low-privilege access to a model-serving platform (e.g., an ML engineer or external partner with upload rights) crafts a malicious SavedModel by manipulating the reshape operation metadata to produce an invalid graph that passes initial validation but triggers a CHECK failure inside IsSimplifiableReshape during Grappler's constant-folding pass. When the serving infrastructure loads this model, the TF process aborts immediately. In an automated CI/CD pipeline, this causes repeated build failures. Against a live serving endpoint, continuous resubmission keeps the process in a crash loop, effectively taking the inference API offline. No shellcode or exploit toolkit required—only knowledge of TF's SavedModel protobuf format.
Weaknesses (CWE)
CWE-617 — Reachable Assertion: The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
- [Implementation] If the assertion statement is required (e.g., for security or reliability), change the invoking code to avoid the conditions that trigger the assertion.
- [Implementation] Consider changing the assertion to some other less "fatal" error. This might not be easy to implement, since other code may be needed to handle the error.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HReferences
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/grappler/optimizers/constant_folding.ccExploit3rd Party
- github.com/tensorflow/tensorflow/commit/1fb27733f943295d874417630edd3b38b34ce082Patch3rd Party
- github.com/tensorflow/tensorflow/commit/240655511cd3e701155f944a972db71b6c0b1bb6Patch3rd Party
- github.com/tensorflow/tensorflow/commit/ebc1a2ffe5a7573d905e99bd0ee3568ee07c12c1Patch3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-fq86-3f29-px2cPatch3rd Party
Timeline
Related Vulnerabilities
CVE-2020-151969.9TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflowCVE-2026-189489.9Feast: insecure UDF deserialization enables RCE
Same package: tensorflowCVE-2020-152059.8TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflowCVE-2019-167789.8TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflowCVE-2020-152089.8TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow