Skip to main content

CVE-2022-23558: CWE-190: Integer Overflow or Wraparound in tensorflow tensorflow

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

Description

Tensorflow is an Open Source Machine Learning Framework. An attacker can craft a TFLite model that would cause an integer overflow in `TfLiteIntArrayCreate`. The `TfLiteIntArrayGetSizeInBytes` returns an `int` instead of a `size_t. An attacker can control model inputs such that `computed_size` overflows the size of `int` datatype. 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/22/2025, 03:21:38 UTC

Technical Analysis

CVE-2022-23558 is a medium-severity vulnerability in the TensorFlow open-source machine learning framework, specifically affecting certain versions prior to 2.7.1, 2.6.3, and 2.5.3. The vulnerability arises from an integer overflow or wraparound issue (CWE-190) in the function TfLiteIntArrayCreate, which is used in the TensorFlow Lite (TFLite) component. The root cause is that the function TfLiteIntArrayGetSizeInBytes returns an int type instead of a size_t, which can lead to an integer overflow when calculating the size of an array. An attacker can craft a malicious TFLite model with inputs that cause the computed size to exceed the maximum value representable by an int, resulting in an overflow. This can lead to memory corruption, potentially causing crashes, denial of service, or even arbitrary code execution depending on the context in which the vulnerable function is used. The flaw affects multiple TensorFlow versions that are still supported, and patches have been planned for TensorFlow 2.8.0 and backported to earlier supported versions. No known exploits have been reported in the wild as of the publication date. The vulnerability requires the attacker to supply a malicious TFLite model, which implies some level of access or interaction with the system that processes these models. The issue impacts the integrity and availability of systems running vulnerable TensorFlow versions, particularly those that process untrusted or user-supplied TFLite models.

Potential Impact

For European organizations, the impact of this vulnerability depends largely on their use of TensorFlow, especially TensorFlow Lite, in production environments. Organizations involved in AI/ML development, edge computing, IoT devices, or mobile applications that utilize TFLite models are at risk. Exploitation could lead to denial of service or potentially remote code execution if the malicious model is processed by vulnerable systems, undermining system integrity and availability. This could disrupt critical AI-driven services, including healthcare diagnostics, financial modeling, autonomous systems, and industrial automation, which are increasingly prevalent in Europe. Additionally, organizations that rely on third-party AI solutions embedding vulnerable TensorFlow versions may be indirectly affected. The confidentiality impact is limited unless the vulnerability is chained with other exploits. Given the growing adoption of AI technologies in European industries, the vulnerability poses a moderate risk to operational continuity and trustworthiness of AI systems.

Mitigation Recommendations

European organizations should prioritize upgrading TensorFlow to versions 2.7.1, 2.6.3, 2.5.3 or later, where the integer overflow issue is patched. For environments where immediate upgrade is not feasible, organizations should implement strict validation and sanitization of all TFLite models before processing, including verifying model provenance and integrity. Deploy runtime protections such as sandboxing or containerization to isolate TensorFlow processes handling untrusted models, limiting the impact of potential exploitation. Monitoring for abnormal crashes or behavior in AI model processing pipelines can help detect exploitation attempts. Additionally, organizations should review their supply chain and third-party AI components to ensure they do not incorporate vulnerable TensorFlow versions. Incorporating static and dynamic analysis tools to detect unsafe integer operations in custom AI model processing code can further reduce risk. Finally, educating developers and AI engineers about secure model handling and patch management is critical to maintaining a secure AI infrastructure.

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

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

Last enriched: 6/22/2025, 3:21:38 AM

Last updated: 7/31/2025, 1:13:41 PM

Views: 11

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