CVE-2021-37679: google tensorflow Out-of-bounds Read
Vulnerability summary
CVE-2021-37679 is a high (CVSS 7.8) Out-of-bounds Read vulnerability in google tensorflow. EPSS estimates a 0.18% chance of exploitation in the next 30 days, higher than 7.1% of scored vulnerabilities.
Advisory lineage
Upstream 0 · Downstream 1 · Related 1Timeline
- 12-08-2021PublishedVulnerability first disclosed.
- 04-08-2024Last modifiedVulnerability information updated.
Description
TensorFlow is an end-to-end open source platform for machine learning. In affected versions it is possible to nest a `tf.map_fn` within another `tf.map_fn` call. However, if the input tensor is a `RaggedTensor` and there is no function signature provided, code assumes the output is a fully specified tensor and fills output buffer with uninitialized contents from the heap. The `t` and `z` outputs should be identical, however this is not the case. The last row of `t` contains data from the heap which can be used to leak other memory information. The bug lies in the conversion from a `Variant` tensor to a `RaggedTensor`. The [implementation](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/core/kernels/ragged_tensor_from_variant_op.cc#L177-L190) does not check that all inner shapes match and this results in the additional dimensions. The same implementation can result in data loss, if input tensor is tweaked. We have patched the issue in GitHub commit 4e2565483d0ffcadc719bd44893fb7f609bb5f12. 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.
CVSS metrics
5 scores · 3 sources · 3 versions- CVE.orgCNA7.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:NDiffers
- OSV · PypiEcosystem advisory · calculated7.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:NDiffers
EPSS trend
Probability
0.18%
Chance of exploitation in the next 30 days
Percentile
7%
Versus all other CVEs
30-day change
0.00 pp
From 0.18% on 18-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-125Out-of-bounds ReadThe product reads data past the end, or before the beginning, of the intended buffer.
- CWE-681Incorrect Conversion between Numeric TypesWhen converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.
Affected systems
PyPI3 products
- tensorflow< 2.3.4 | ≥ 2.5.0, < 2.5.1 | < 4e2565483d0ffcadc719bd44893fb7f609bb5f12 | ≥ 2.4.0, < 2.4.3
- tensorflow-cpu< 2.3.4 | ≥ 2.5.0, < 2.5.1 | < 4e2565483d0ffcadc719bd44893fb7f609bb5f12 | ≥ 2.4.0, < 2.4.3
- tensorflow-gpu< 2.3.4 | ≥ 2.5.0, < 2.5.1 | < 4e2565483d0ffcadc719bd44893fb7f609bb5f12 | ≥ 2.4.0, < 2.4.3
Google1 product
- tensorflow≥ 2.3.0, < 2.3.4 | ≥ 2.4.0, < 2.4.3 | 2.5.0 | 2.6.0:rc0 | 2.6.0:rc1 | 2.6.0:rc2
Tensorflow1 product
- tensorflow≥ 2.5.0, < 2.5.1 | ≥ 2.4.0, < 2.4.3 | < 2.3.4
3 vendors · 5 products
References
7 links- github.com/tensorflow/tensorflow/security/advisories/GHSA-g8wg-cjwc-xhhpX Refsource CONFIRMWEBAdvisoryThird Party Advisory
- github.com/tensorflow/tensorflow/commit/4e2565483d0ffcadc719bd44893fb7f609bb5f12X Refsource MISCWEBFIXPatchThird Party Advisory