CVE-2022-41887: CWE-131: Incorrect Calculation of Buffer Size in tensorflow tensorflow
TensorFlow is an open source platform for machine learning. `tf.keras.losses.poisson` receives a `y_pred` and `y_true` that are passed through `functor::mul` in `BinaryOp`. If the resulting dimensions overflow an `int32`, TensorFlow will crash due to a size mismatch during broadcast assignment. We have patched the issue in GitHub commit c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1 and 2.9.3, as these are also affected and still in supported range. However, we will not cherrypick this commit into TensorFlow 2.8.x, as it depends on Eigen behavior that changed between 2.8 and 2.9.
AI Analysis
Technical Summary
CVE-2022-41887 is a medium-severity vulnerability in TensorFlow, an open-source machine learning platform widely used for developing and deploying ML models. The vulnerability arises from an incorrect calculation of buffer size (CWE-131) in the tf.keras.losses.poisson function. Specifically, when the inputs y_pred and y_true are processed through the functor::mul operation within the BinaryOp module, the resulting tensor dimensions can overflow a 32-bit integer (int32). This overflow leads to a size mismatch during broadcast assignment, causing TensorFlow to crash. The root cause is an integer overflow that results in an incorrect buffer size allocation, which compromises the stability of the TensorFlow process. The issue affects TensorFlow versions from 2.9.0 up to but not including 2.9.3, and from 2.10.0 up to but not including 2.10.1. The vulnerability has been patched in TensorFlow 2.11 and backported to versions 2.10.1 and 2.9.3. However, it is not patched in the 2.8.x branch due to dependencies on Eigen library behavior changes. There are no known exploits in the wild at this time. The vulnerability does not directly lead to arbitrary code execution or data leakage but causes denial of service via crashes due to buffer size miscalculations. This can disrupt machine learning workflows and services relying on TensorFlow for critical operations. The vulnerability requires no authentication or user interaction to trigger if the vulnerable function is invoked with crafted inputs that cause dimension overflow. The issue is technical and subtle, related to internal tensor dimension calculations and integer overflow handling during tensor broadcasting operations.
Potential Impact
For European organizations, the impact of CVE-2022-41887 primarily concerns availability and operational stability of machine learning services that utilize affected TensorFlow versions. Organizations relying on TensorFlow for data analytics, AI-driven decision-making, or automated processes may experience unexpected crashes, leading to service interruptions or degraded performance. This can affect sectors such as finance, healthcare, manufacturing, and research institutions where TensorFlow is integrated into production pipelines. Although the vulnerability does not directly compromise confidentiality or integrity, denial of service conditions can cause significant disruption, especially in environments requiring high availability or real-time processing. Additionally, organizations using older TensorFlow versions that are no longer supported may be unable to apply patches, increasing their exposure. The lack of known exploits reduces immediate risk, but the potential for crafted inputs to cause crashes means attackers could perform targeted denial of service attacks against AI services. This could be leveraged in multi-stage attacks or to degrade trust in AI systems. The impact is more pronounced for organizations with automated ML workflows that do not validate input tensor dimensions rigorously before processing.
Mitigation Recommendations
European organizations should take the following specific mitigation steps: 1) Identify and inventory all TensorFlow deployments, including containerized and embedded environments, to determine if affected versions (>=2.9.0 and <2.9.3, >=2.10.0 and <2.10.1) are in use. 2) Upgrade TensorFlow to version 2.11 or later, or apply backported patches for versions 2.9.3 and 2.10.1 where feasible. 3) For environments where upgrading is not immediately possible, implement input validation to ensure that tensor dimensions passed to tf.keras.losses.poisson do not cause int32 overflow during multiplication or broadcasting. This can include pre-checks on tensor shapes and sizes to prevent triggering the vulnerability. 4) Monitor application logs and TensorFlow crash reports to detect anomalous crashes that may indicate exploitation attempts or malformed inputs. 5) Incorporate fuzz testing or static analysis tools focused on tensor dimension handling in the ML pipeline to proactively identify similar issues. 6) Educate ML developers and data scientists about safe tensor operations and the risks of unchecked tensor dimension manipulations. 7) For critical production systems, consider deploying runtime protections or sandboxing TensorFlow processes to limit the impact of crashes on overall system availability. 8) Maintain awareness of updates from TensorFlow and related dependencies such as Eigen to ensure compatibility and security.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland, Belgium, Italy, Spain
CVE-2022-41887: CWE-131: Incorrect Calculation of Buffer Size in tensorflow tensorflow
Description
TensorFlow is an open source platform for machine learning. `tf.keras.losses.poisson` receives a `y_pred` and `y_true` that are passed through `functor::mul` in `BinaryOp`. If the resulting dimensions overflow an `int32`, TensorFlow will crash due to a size mismatch during broadcast assignment. We have patched the issue in GitHub commit c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1 and 2.9.3, as these are also affected and still in supported range. However, we will not cherrypick this commit into TensorFlow 2.8.x, as it depends on Eigen behavior that changed between 2.8 and 2.9.
AI-Powered Analysis
Technical Analysis
CVE-2022-41887 is a medium-severity vulnerability in TensorFlow, an open-source machine learning platform widely used for developing and deploying ML models. The vulnerability arises from an incorrect calculation of buffer size (CWE-131) in the tf.keras.losses.poisson function. Specifically, when the inputs y_pred and y_true are processed through the functor::mul operation within the BinaryOp module, the resulting tensor dimensions can overflow a 32-bit integer (int32). This overflow leads to a size mismatch during broadcast assignment, causing TensorFlow to crash. The root cause is an integer overflow that results in an incorrect buffer size allocation, which compromises the stability of the TensorFlow process. The issue affects TensorFlow versions from 2.9.0 up to but not including 2.9.3, and from 2.10.0 up to but not including 2.10.1. The vulnerability has been patched in TensorFlow 2.11 and backported to versions 2.10.1 and 2.9.3. However, it is not patched in the 2.8.x branch due to dependencies on Eigen library behavior changes. There are no known exploits in the wild at this time. The vulnerability does not directly lead to arbitrary code execution or data leakage but causes denial of service via crashes due to buffer size miscalculations. This can disrupt machine learning workflows and services relying on TensorFlow for critical operations. The vulnerability requires no authentication or user interaction to trigger if the vulnerable function is invoked with crafted inputs that cause dimension overflow. The issue is technical and subtle, related to internal tensor dimension calculations and integer overflow handling during tensor broadcasting operations.
Potential Impact
For European organizations, the impact of CVE-2022-41887 primarily concerns availability and operational stability of machine learning services that utilize affected TensorFlow versions. Organizations relying on TensorFlow for data analytics, AI-driven decision-making, or automated processes may experience unexpected crashes, leading to service interruptions or degraded performance. This can affect sectors such as finance, healthcare, manufacturing, and research institutions where TensorFlow is integrated into production pipelines. Although the vulnerability does not directly compromise confidentiality or integrity, denial of service conditions can cause significant disruption, especially in environments requiring high availability or real-time processing. Additionally, organizations using older TensorFlow versions that are no longer supported may be unable to apply patches, increasing their exposure. The lack of known exploits reduces immediate risk, but the potential for crafted inputs to cause crashes means attackers could perform targeted denial of service attacks against AI services. This could be leveraged in multi-stage attacks or to degrade trust in AI systems. The impact is more pronounced for organizations with automated ML workflows that do not validate input tensor dimensions rigorously before processing.
Mitigation Recommendations
European organizations should take the following specific mitigation steps: 1) Identify and inventory all TensorFlow deployments, including containerized and embedded environments, to determine if affected versions (>=2.9.0 and <2.9.3, >=2.10.0 and <2.10.1) are in use. 2) Upgrade TensorFlow to version 2.11 or later, or apply backported patches for versions 2.9.3 and 2.10.1 where feasible. 3) For environments where upgrading is not immediately possible, implement input validation to ensure that tensor dimensions passed to tf.keras.losses.poisson do not cause int32 overflow during multiplication or broadcasting. This can include pre-checks on tensor shapes and sizes to prevent triggering the vulnerability. 4) Monitor application logs and TensorFlow crash reports to detect anomalous crashes that may indicate exploitation attempts or malformed inputs. 5) Incorporate fuzz testing or static analysis tools focused on tensor dimension handling in the ML pipeline to proactively identify similar issues. 6) Educate ML developers and data scientists about safe tensor operations and the risks of unchecked tensor dimension manipulations. 7) For critical production systems, consider deploying runtime protections or sandboxing TensorFlow processes to limit the impact of crashes on overall system availability. 8) Maintain awareness of updates from TensorFlow and related dependencies such as Eigen to ensure compatibility and security.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2022-09-30T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9849c4522896dcbf6cb7
Added to database: 5/21/2025, 9:09:29 AM
Last enriched: 6/21/2025, 9:22:07 PM
Last updated: 7/26/2025, 4:15:32 AM
Views: 11
Related Threats
CVE-2025-55159: CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer in tokio-rs slab
MediumCVE-2025-55161: CWE-918: Server-Side Request Forgery (SSRF) in Stirling-Tools Stirling-PDF
HighCVE-2025-25235: CWE-918 Server-Side Request Forgery (SSRF) in Omnissa Secure Email Gateway
HighCVE-2025-55151: CWE-918: Server-Side Request Forgery (SSRF) in Stirling-Tools Stirling-PDF
HighCVE-2025-55150: CWE-918: Server-Side Request Forgery (SSRF) in Stirling-Tools Stirling-PDF
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.