CVE-2022-23581: TensorFlow: DoS via Grappler optimizer CHECK failure
MEDIUM PoC AVAILABLEAny 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.
Risk Assessment
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.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
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).
-
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.
Classification
Compliance Impact
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 0.48%.
Technical Details
NVD Description
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)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/grappler/optimizers/constant_folding.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/1fb27733f943295d874417630edd3b38b34ce082 Patch 3rd Party
- github.com/tensorflow/tensorflow/commit/240655511cd3e701155f944a972db71b6c0b1bb6 Patch 3rd Party
- github.com/tensorflow/tensorflow/commit/ebc1a2ffe5a7573d905e99bd0ee3568ee07c12c1 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-fq86-3f29-px2c 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