CVE-2021-37654: TensorFlow - Out of Bounds Read
- Cve: CVE-2021-37654
- Name: TensorFlow - Out of Bounds Read
- Description: TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can trigger a crash via a `CHECK`-fail in debug builds of TensorFlow using `tf.raw_ops.ResourceGather` or a read from outside the bounds of heap allocated data in the same API in a release build. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/resource_variable_ops.cc#L660-L668) does not check that the `batch_dims` value that the user supplies is less than the rank of the input tensor. Since the implementation uses several for loops over the dimensions of `tensor`, this results in reading data from outside the bounds of heap allocated buffer backing the tensor. We have patched the issue in GitHub commit bc9c546ce7015c57c2f15c168b3d9201de679a1d. 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.
- Impact: Attackers can cause crashes or read out-of-bounds data, potentially leading to denial of service or information disclosure.
- Remediation: Update to TensorFlow 2.6.0 or apply the patch from commit bc9c546ce7015c57c2f15c168b3d9201de679a1d in affected versions.
- Vulnerability type: out_of_bounds_rw
- Vulnerability impact: denial_of_service, information_disclosure
- Requirement type: none
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 7.1
- Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
- Epss score: 0.00167
- Epss percentile: 0.05923
- Assignee: [email protected]
- Published at: 2021-08-12T21:15:08Z
- Age in days: 1930
- Modified at: 2026-06-17T04:00:54Z
- Patch available: yes
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-37654
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-125 | Out-of-bounds Read |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/tensorflow/tensorflow/commit/bc9c546ce7015c57c2f15c168b3d9201de679a1d | nvd | Patch, Third Party Advisory |
| https://github.com/tensorflow/tensorflow/security/advisories/GHSA-2r8p-fg3c-wcj4 | nvd | Third Party Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| google:tensorflow | = 2.6.0 rc0; = 2.6.0 rc1; = 2.6.0 rc2; = 2.5.0; >= 2.4.0, < 2.4.3; >= 2.3.0, < 2.3.4 | no | nvd | /v1/products/google/tensorflow |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| tensorflow/tensorflow | commit, security_advisory | yes | /v1/repositories/tensorflow/tensorflow |
Index
- Repositories: 340
- Repositories high signal: 133
- Packages: 3
Exploitation
- Authentication required: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts