Skip to main content

CVE-2022-35952: CWE-617: Reachable Assertion in tensorflow tensorflow

Medium
Published: Fri Sep 16 2022 (09/16/2022, 19:50:10 UTC)
Source: CVE
Vendor/Project: tensorflow
Product: tensorflow

Description

TensorFlow is an open source platform for machine learning. The `UnbatchGradOp` function takes an argument `id` that is assumed to be a scalar. A nonscalar `id` can trigger a `CHECK` failure and crash the program. It also requires its argument `batch_index` to contain three times the number of elements as indicated in its `batch_index.dim_size(0)`. An incorrect `batch_index` can trigger a `CHECK` failure and crash the program. We have patched the issue in GitHub commit 5f945fc6409a3c1e90d6970c9292f805f6e6ddf2. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.

AI-Powered Analysis

AILast updated: 06/22/2025, 20:20:18 UTC

Technical Analysis

CVE-2022-35952 is a medium-severity vulnerability identified in TensorFlow, an open-source machine learning platform widely used for developing and deploying machine learning models. The vulnerability resides in the `UnbatchGradOp` function, which processes gradient unbatching operations. Specifically, the function expects the argument `id` to be a scalar value; however, if a nonscalar `id` is provided, it triggers a `CHECK` assertion failure, causing the program to crash. Additionally, the function requires the `batch_index` argument to have a size exactly three times the number of elements indicated by its first dimension (`batch_index.dim_size(0)`). If this condition is violated, another `CHECK` assertion failure occurs, also resulting in a program crash. These assertion failures are reachable, meaning that crafted inputs can directly cause the application to terminate unexpectedly. The issue affects TensorFlow versions prior to 2.7.2, versions between 2.8.0 and 2.8.1, and versions between 2.9.0 and 2.9.1. The vulnerability has been patched in TensorFlow 2.10.0 and backported to supported versions 2.7.2, 2.8.1, and 2.9.1. There are no known workarounds, and no exploits have been observed in the wild to date. The vulnerability is classified under CWE-617 (Reachable Assertion), indicating that the program contains assertions that can be triggered by external input, leading to denial of service through crashes. This vulnerability primarily impacts the availability of TensorFlow-based applications by causing unexpected termination when processing malformed inputs. It does not directly lead to code execution or data leakage but can disrupt machine learning workflows and services relying on TensorFlow for model training or inference.

Potential Impact

For European organizations, the impact of CVE-2022-35952 is primarily related to availability disruptions in machine learning services and applications that utilize affected TensorFlow versions. Organizations in sectors such as finance, healthcare, automotive, and manufacturing, which increasingly rely on AI and machine learning for critical operations, could experience service interruptions or degraded performance if adversaries supply malformed inputs triggering these assertion failures. Although the vulnerability does not enable remote code execution or data breaches, denial of service conditions can lead to operational downtime, delayed analytics, and potential financial losses. Additionally, organizations providing AI-as-a-Service or cloud-based machine learning platforms may face reputational damage and customer dissatisfaction if their services become unstable due to this vulnerability. Since no authentication or user interaction is required to trigger the assertion failures, attackers with network or API access to TensorFlow-powered services could exploit this vulnerability to cause crashes. However, the lack of known exploits in the wild suggests limited active targeting at present. Nonetheless, the risk remains relevant for organizations deploying vulnerable TensorFlow versions in production environments, especially those exposed to untrusted inputs or external users.

Mitigation Recommendations

To mitigate CVE-2022-35952, European organizations should prioritize upgrading TensorFlow to version 2.10.0 or later, or apply the relevant patches backported to versions 2.7.2, 2.8.1, and 2.9.1. Since no workarounds exist, patching is the most effective measure. Organizations should audit their environments to identify all instances of TensorFlow in use, including embedded or containerized deployments, to ensure comprehensive remediation. Additionally, implementing input validation and sanitization at the application layer before inputs reach TensorFlow can reduce the risk of malformed data triggering assertion failures. Monitoring and logging TensorFlow application crashes can help detect attempted exploitation or instability caused by this vulnerability. For externally facing services, applying network segmentation and access controls to limit exposure of TensorFlow APIs to trusted users can reduce attack surface. Finally, organizations should incorporate this vulnerability into their incident response and vulnerability management processes to ensure timely detection and remediation of related issues.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9845c4522896dcbf4008

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

Last enriched: 6/22/2025, 8:20:18 PM

Last updated: 8/12/2025, 10:38:14 AM

Views: 10

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