Skip to main content

CVE-2022-23591: CWE-400: Uncontrolled Resource Consumption in tensorflow tensorflow

Medium
Published: Fri Feb 04 2022 (02/04/2022, 22:32:09 UTC)
Source: CVE
Vendor/Project: tensorflow
Product: tensorflow

Description

Tensorflow is an Open Source Machine Learning Framework. The `GraphDef` format in TensorFlow does not allow self recursive functions. The runtime assumes that this invariant is satisfied. However, a `GraphDef` containing a fragment such as the following can be consumed when loading a `SavedModel`. This would result in a stack overflow during execution as resolving each `NodeDef` means resolving the function itself and its nodes. 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.

AI-Powered Analysis

AILast updated: 06/23/2025, 17:49:24 UTC

Technical Analysis

CVE-2022-23591 is a medium-severity vulnerability in TensorFlow, an open-source machine learning framework widely used for developing and deploying machine learning models. The vulnerability arises from the way TensorFlow processes its GraphDef format, which represents computational graphs. Specifically, TensorFlow's runtime assumes that the GraphDef does not contain self-recursive functions. However, an attacker can craft a malicious GraphDef containing self-recursive NodeDefs. When such a GraphDef is loaded via a SavedModel, the runtime attempts to resolve each NodeDef, including the recursive function calls, leading to uncontrolled resource consumption and ultimately a stack overflow during execution. This can cause the TensorFlow process to crash or become unresponsive, resulting in a denial of service (DoS). The affected versions include TensorFlow versions from 2.5.0 up to but not including 2.5.3, 2.6.0 up to but not including 2.6.3, and 2.7.0 up to but not including 2.7.1. The issue was fixed starting with TensorFlow 2.8.0, with backported patches for the affected supported versions. There are no known exploits in the wild at this time. The vulnerability is classified under CWE-400 (Uncontrolled Resource Consumption), indicating that the flaw allows an attacker to cause excessive resource usage, potentially disrupting service availability. Exploitation requires the ability to supply a malicious SavedModel to the TensorFlow runtime, which may require some level of access to the environment where TensorFlow is running or the ability to influence model loading. No authentication or user interaction is explicitly required once the malicious model is loaded. The impact is primarily on availability due to stack overflow and process crashes.

Potential Impact

For European organizations, the impact of CVE-2022-23591 depends on the extent to which TensorFlow is used in their infrastructure, particularly in production environments where models are dynamically loaded or updated. Organizations leveraging TensorFlow for critical AI workloads, such as financial institutions using machine learning for fraud detection, healthcare providers using AI for diagnostics, or manufacturing firms employing AI for predictive maintenance, could face service disruptions if a malicious or malformed model is loaded. The vulnerability could be exploited to cause denial of service, leading to downtime, degraded service quality, or interruption of automated decision-making processes. While the vulnerability does not directly lead to data confidentiality or integrity breaches, the availability impact could indirectly affect business operations and compliance with service level agreements (SLAs). Additionally, organizations that accept third-party or user-submitted models without strict validation could be at higher risk. Given the increasing adoption of AI and machine learning across European industries, this vulnerability poses a tangible risk to operational continuity if unpatched TensorFlow versions are in use.

Mitigation Recommendations

1. Upgrade TensorFlow to version 2.8.0 or later, or apply the backported patches for versions 2.7.1, 2.6.3, and 2.5.3 as soon as possible to eliminate the vulnerability. 2. Implement strict validation and sanitization of all SavedModel files before loading them into TensorFlow environments, especially if models are sourced externally or from untrusted parties. This includes verifying the absence of recursive function definitions or malformed GraphDefs. 3. Restrict the ability to upload or modify models to trusted personnel and enforce strong access controls on model repositories and deployment pipelines. 4. Monitor TensorFlow runtime logs and system resource usage for unusual spikes that could indicate exploitation attempts involving resource exhaustion. 5. Employ containerization or sandboxing techniques for TensorFlow model execution to limit the impact of potential crashes and isolate affected workloads. 6. Incorporate automated testing that includes malformed or edge-case models to detect potential resource consumption issues during development and deployment phases. 7. Maintain an inventory of TensorFlow versions in use across the organization to ensure timely patch management and vulnerability remediation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-01-19T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9842c4522896dcbf2393

Added to database: 5/21/2025, 9:09:22 AM

Last enriched: 6/23/2025, 5:49:24 PM

Last updated: 8/12/2025, 6:05:40 AM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats