CVE-2021-37635 in TensorFlowinfo

Summary

by MITRE • 08/13/2021

TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of sparse reduction operations in TensorFlow can trigger accesses outside of bounds of heap allocated data. The [implementation](https://github.com/tensorflow/tensorflow/blob/a1bc56203f21a5a4995311825ffaba7a670d7747/tensorflow/core/kernels/sparse_reduce_op.cc#L217-L228) fails to validate that each reduction group does not overflow and that each corresponding index does not point to outside the bounds of the input tensor. We have patched the issue in GitHub commit 87158f43f05f2720a374f3e6d22a7aaa3a33f750. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 08/17/2021

The vulnerability CVE-2021-37635 affects TensorFlow, a widely-used open-source machine learning platform that processes sparse reduction operations through its kernel implementations. This issue stems from insufficient bounds checking within the sparse reduction functionality that handles heap-allocated data structures. The flaw manifests when the implementation fails to validate that reduction groups do not exceed allocated memory boundaries and that corresponding indices do not reference memory locations outside the valid input tensor range. Such oversights create potential for out-of-bounds memory accesses that could lead to system instability or exploitation.

The technical implementation flaw exists specifically within the sparse_reduce_op.cc file where the code processes sparse reduction operations without adequate validation of index boundaries. According to the affected code segments referenced in the commit, the system does not properly verify that each reduction group remains within allocated heap memory limits and that each index corresponds to valid tensor positions. This gap in validation allows for potential buffer overflows or memory corruption scenarios when processing sparse tensor data structures that contain malformed or malicious indices.

The operational impact of this vulnerability extends across multiple TensorFlow versions including 2.3.4, 2.4.3, 2.5.1, and the affected 2.6.0 release. Attackers could potentially exploit this weakness by crafting malicious sparse tensor inputs that trigger memory access violations, leading to denial of service conditions or potentially more severe exploitation vectors. The vulnerability aligns with CWE-129, which addresses insufficient validation of length of input buffers, and represents a classic example of improper bounds checking in memory management operations. This type of vulnerability falls under ATT&CK technique T1059.001, where adversaries may abuse system resources through memory corruption techniques.

The TensorFlow team has addressed this vulnerability through a specific code fix implemented in GitHub commit 87158f43f05f2720a374f3e6d22a7aaa3a33f750. The patch ensures proper bounds validation during sparse reduction operations by implementing comprehensive checks on index ranges and memory allocation boundaries. This fix has been incorporated into the TensorFlow 2.6.0 release and backported to the supported maintenance versions 2.5.1, 2.4.3, and 2.3.4. Organizations using affected TensorFlow versions should immediately upgrade to the patched releases or apply the cherry-picked fixes to maintain system integrity and prevent potential exploitation of this memory safety vulnerability. The resolution demonstrates proper defensive programming practices that align with secure coding standards and industry best practices for preventing memory corruption vulnerabilities in machine learning frameworks.

Responsible

GitHub, Inc.

Reservation

07/29/2021

Disclosure

08/13/2021

Moderation

accepted

CPE

ready

EPSS

0.00167

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!