CVE-2022-35939: CWE-787: Out-of-bounds Write in tensorflow tensorflow
TensorFlow is an open source platform for machine learning. The `ScatterNd` function takes an input argument that determines the indices of of the output tensor. An input index greater than the output tensor or less than zero will either write content at the wrong index or trigger a crash. We have patched the issue in GitHub commit b4d4b4cb019bd7240a52daa4ba61e3cc814f0384. 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 Analysis
Technical Summary
CVE-2022-35939 is a medium-severity vulnerability in TensorFlow, an open-source machine learning platform widely used for developing and deploying machine learning models. The vulnerability arises from an out-of-bounds write condition in the ScatterNd function. ScatterNd is responsible for updating elements of an output tensor at specified indices. The flaw occurs when the input indices provided to ScatterNd are either greater than the dimensions of the output tensor or less than zero. In such cases, the function may write data to incorrect memory locations, leading to memory corruption, or cause the application to crash. This vulnerability is classified under CWE-787 (Out-of-bounds Write), which can lead to undefined behavior, including potential denial of service or exploitation for arbitrary code execution if an attacker can control the input indices. The issue affects TensorFlow versions prior to 2.7.2, as well as certain patch versions in the 2.8.x and 2.9.x branches. The TensorFlow maintainers have addressed the vulnerability in commit b4d4b4cb019bd7240a52daa4ba61e3cc814f0384, with fixes backported to supported versions 2.7.2, 2.8.1, and 2.9.1, and included in the upcoming 2.10.0 release. No known workarounds exist, and no exploits have been reported in the wild to date. Exploitation requires supplying crafted input indices to the ScatterNd function, which implies that the attacker must have the ability to influence the input data to TensorFlow operations. This vulnerability primarily impacts applications and services that utilize vulnerable TensorFlow versions for machine learning workloads, especially those that process untrusted or user-supplied data. Given TensorFlow's extensive use in research, industry, and cloud environments, this vulnerability could have broad implications if exploited.
Potential Impact
For European organizations, the impact of CVE-2022-35939 depends on their reliance on vulnerable TensorFlow versions within their machine learning pipelines. Organizations in sectors such as finance, healthcare, automotive, and telecommunications that deploy machine learning models for critical decision-making or customer-facing services could face risks including service disruption due to crashes or potential unauthorized code execution if the vulnerability is exploited. This could lead to confidentiality breaches if sensitive data is exposed, integrity issues if model outputs are manipulated, and availability problems if services crash. Since exploitation requires control over input indices, the risk is higher for organizations processing untrusted or external data streams. Additionally, organizations using TensorFlow in cloud environments or offering ML-as-a-service could see amplified impact due to multi-tenant environments and broader attack surfaces. The absence of known exploits reduces immediate risk, but the vulnerability's nature means that motivated attackers could develop exploits, especially targeting high-value European organizations with strategic importance in AI and machine learning. Compliance with EU data protection regulations (e.g., GDPR) could be affected if data confidentiality or integrity is compromised. Therefore, timely patching is critical to mitigate potential operational, reputational, and regulatory impacts.
Mitigation Recommendations
1. Immediate upgrade to patched TensorFlow versions: Organizations should prioritize upgrading to TensorFlow 2.7.2, 2.8.1, 2.9.1, or later versions including 2.10.0 where the fix is included. 2. Audit and restrict input data: Implement strict validation and sanitization of all input indices passed to ScatterNd or similar tensor operations to prevent out-of-bounds values. 3. Isolate ML workloads: Run TensorFlow workloads in sandboxed or containerized environments with limited privileges to contain potential exploitation impact. 4. Monitor for anomalous behavior: Deploy runtime monitoring to detect crashes or unusual memory access patterns in TensorFlow processes that could indicate exploitation attempts. 5. Review and limit exposure: Identify and restrict external or untrusted data sources feeding into TensorFlow models, especially those using ScatterNd, to reduce attack surface. 6. Engage with vendors and cloud providers: Ensure that third-party ML platforms or cloud services used by the organization have applied the relevant patches. 7. Incident response readiness: Prepare for potential exploitation by updating incident response plans to include TensorFlow-related vulnerabilities and conduct tabletop exercises. These measures go beyond generic patching by emphasizing input validation, workload isolation, and proactive monitoring tailored to the nature of this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Belgium, Italy
CVE-2022-35939: CWE-787: Out-of-bounds Write in tensorflow tensorflow
Description
TensorFlow is an open source platform for machine learning. The `ScatterNd` function takes an input argument that determines the indices of of the output tensor. An input index greater than the output tensor or less than zero will either write content at the wrong index or trigger a crash. We have patched the issue in GitHub commit b4d4b4cb019bd7240a52daa4ba61e3cc814f0384. 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
Technical Analysis
CVE-2022-35939 is a medium-severity vulnerability in TensorFlow, an open-source machine learning platform widely used for developing and deploying machine learning models. The vulnerability arises from an out-of-bounds write condition in the ScatterNd function. ScatterNd is responsible for updating elements of an output tensor at specified indices. The flaw occurs when the input indices provided to ScatterNd are either greater than the dimensions of the output tensor or less than zero. In such cases, the function may write data to incorrect memory locations, leading to memory corruption, or cause the application to crash. This vulnerability is classified under CWE-787 (Out-of-bounds Write), which can lead to undefined behavior, including potential denial of service or exploitation for arbitrary code execution if an attacker can control the input indices. The issue affects TensorFlow versions prior to 2.7.2, as well as certain patch versions in the 2.8.x and 2.9.x branches. The TensorFlow maintainers have addressed the vulnerability in commit b4d4b4cb019bd7240a52daa4ba61e3cc814f0384, with fixes backported to supported versions 2.7.2, 2.8.1, and 2.9.1, and included in the upcoming 2.10.0 release. No known workarounds exist, and no exploits have been reported in the wild to date. Exploitation requires supplying crafted input indices to the ScatterNd function, which implies that the attacker must have the ability to influence the input data to TensorFlow operations. This vulnerability primarily impacts applications and services that utilize vulnerable TensorFlow versions for machine learning workloads, especially those that process untrusted or user-supplied data. Given TensorFlow's extensive use in research, industry, and cloud environments, this vulnerability could have broad implications if exploited.
Potential Impact
For European organizations, the impact of CVE-2022-35939 depends on their reliance on vulnerable TensorFlow versions within their machine learning pipelines. Organizations in sectors such as finance, healthcare, automotive, and telecommunications that deploy machine learning models for critical decision-making or customer-facing services could face risks including service disruption due to crashes or potential unauthorized code execution if the vulnerability is exploited. This could lead to confidentiality breaches if sensitive data is exposed, integrity issues if model outputs are manipulated, and availability problems if services crash. Since exploitation requires control over input indices, the risk is higher for organizations processing untrusted or external data streams. Additionally, organizations using TensorFlow in cloud environments or offering ML-as-a-service could see amplified impact due to multi-tenant environments and broader attack surfaces. The absence of known exploits reduces immediate risk, but the vulnerability's nature means that motivated attackers could develop exploits, especially targeting high-value European organizations with strategic importance in AI and machine learning. Compliance with EU data protection regulations (e.g., GDPR) could be affected if data confidentiality or integrity is compromised. Therefore, timely patching is critical to mitigate potential operational, reputational, and regulatory impacts.
Mitigation Recommendations
1. Immediate upgrade to patched TensorFlow versions: Organizations should prioritize upgrading to TensorFlow 2.7.2, 2.8.1, 2.9.1, or later versions including 2.10.0 where the fix is included. 2. Audit and restrict input data: Implement strict validation and sanitization of all input indices passed to ScatterNd or similar tensor operations to prevent out-of-bounds values. 3. Isolate ML workloads: Run TensorFlow workloads in sandboxed or containerized environments with limited privileges to contain potential exploitation impact. 4. Monitor for anomalous behavior: Deploy runtime monitoring to detect crashes or unusual memory access patterns in TensorFlow processes that could indicate exploitation attempts. 5. Review and limit exposure: Identify and restrict external or untrusted data sources feeding into TensorFlow models, especially those using ScatterNd, to reduce attack surface. 6. Engage with vendors and cloud providers: Ensure that third-party ML platforms or cloud services used by the organization have applied the relevant patches. 7. Incident response readiness: Prepare for potential exploitation by updating incident response plans to include TensorFlow-related vulnerabilities and conduct tabletop exercises. These measures go beyond generic patching by emphasizing input validation, workload isolation, and proactive monitoring tailored to the nature of this vulnerability.
Affected Countries
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-07-15T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9845c4522896dcbf3ff8
Added to database: 5/21/2025, 9:09:25 AM
Last enriched: 6/22/2025, 8:20:51 PM
Last updated: 7/26/2025, 7:22:58 PM
Views: 12
Related Threats
CVE-2025-8452: CWE-538 Insertion of Sensitive Information into Externally-Accessible File or Directory in Brother Industries, Ltd HL-L8260CDN
MediumCVE-2025-5468: CWE-61: UNIX Symbolic Link in Ivanti Connect Secure
MediumCVE-2025-5466: CWE-776 Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') in Ivanti Connect Secure
MediumCVE-2025-5456: CWE-125 Out-of-bounds Read in Ivanti Connect Secure
HighCVE-2025-3831: CWE-200: Exposure of Sensitive Information to an Unauthorized Actor. in checkpoint Check Point Harmony SASE
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.