Skip to main content

CVE-2022-35996: CWE-369: Divide By Zero in tensorflow tensorflow

Medium
VulnerabilityCVE-2022-35996cvecve-2022-35996cwe-369-divide-by-zero
Published: Fri Sep 16 2022 (09/16/2022, 22:55:10 UTC)
Source: CVE
Vendor/Project: tensorflow
Product: tensorflow

Description

TensorFlow is an open source platform for machine learning. If `Conv2D` is given empty `input` and the `filter` and `padding` sizes are valid, the output is all-zeros. This causes division-by-zero floating point exceptions that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 611d80db29dd7b0cfb755772c69d60ae5bca05f9. 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, 18:19:56 UTC

Technical Analysis

CVE-2022-35996 is a medium-severity vulnerability in TensorFlow, an open-source machine learning platform widely used for developing and deploying machine learning models. The issue arises specifically in the Conv2D operation, which is a core convolutional layer used in many neural network architectures for image and signal processing. When the Conv2D function is provided with an empty input tensor, but valid filter and padding sizes, the output tensor is computed as all zeros. This scenario triggers a division-by-zero floating point exception internally, resulting in a runtime error. Such an exception can be exploited to cause a denial of service (DoS) condition by crashing or halting the TensorFlow process or service that is running the vulnerable code. The vulnerability affects TensorFlow versions prior to 2.7.2, and certain minor versions in the 2.8.x and 2.9.x release lines. The issue has been patched in TensorFlow 2.10.0 and backported to supported versions 2.7.2, 2.8.1, and 2.9.1. No known workarounds exist other than upgrading to a patched version. There are no known exploits in the wild at this time. The root cause is classified under CWE-369 (Divide By Zero), indicating a failure to properly validate or handle edge cases in input data leading to unsafe arithmetic operations. The vulnerability requires that the attacker can supply crafted input tensors to the Conv2D operation, which may be possible in environments where untrusted or malformed data is processed by TensorFlow models. However, no authentication or user interaction is explicitly required beyond the ability to influence input data to the vulnerable function. The impact is primarily denial of service rather than code execution or data leakage.

Potential Impact

For European organizations leveraging TensorFlow in production environments—such as in AI-driven analytics, image recognition, or automated decision-making systems—this vulnerability could lead to service disruptions. A denial of service triggered by crafted inputs could interrupt critical machine learning workflows, degrade system availability, and potentially impact dependent business processes. Organizations in sectors like healthcare, automotive, finance, and manufacturing that rely on TensorFlow for real-time or batch processing could experience operational downtime or delays. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact could be significant if exploited in high-throughput or safety-critical applications. Given TensorFlow's widespread adoption in research institutions and enterprises across Europe, unpatched systems remain at risk. The absence of known exploits reduces immediate threat but does not eliminate the risk of future attacks, especially as adversaries may develop exploits targeting this flaw. Additionally, environments exposing TensorFlow inference services to external or semi-trusted users are at higher risk, as attackers could supply malicious inputs remotely. The lack of workarounds means patching is the only effective mitigation, emphasizing the need for timely updates to avoid service interruptions.

Mitigation Recommendations

1. Immediate upgrade to TensorFlow versions 2.7.2, 2.8.1, 2.9.1, or later (including 2.10.0) where the fix has been applied. 2. Implement input validation and sanitization at the application level to detect and reject empty input tensors before they reach the Conv2D operation, reducing the risk of triggering the divide-by-zero condition. 3. Deploy runtime monitoring and anomaly detection to identify unusual crashes or exceptions related to TensorFlow processes, enabling rapid incident response. 4. For environments exposing TensorFlow inference APIs externally, enforce strict access controls and input validation to limit exposure to crafted inputs. 5. Use containerization or sandboxing to isolate TensorFlow workloads, minimizing the impact of potential crashes on broader systems. 6. Maintain an inventory of TensorFlow versions in use across the organization to ensure all instances are identified and updated promptly. 7. Engage with TensorFlow community and security advisories to stay informed about patches and emerging threats related to this vulnerability. These steps go beyond generic advice by focusing on proactive input validation, runtime monitoring, and operational controls tailored to TensorFlow deployments.

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: 682d9845c4522896dcbf42f4

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

Last enriched: 6/22/2025, 6:19:56 PM

Last updated: 7/28/2025, 10:34:24 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