Skip to content
HighVulnerability

CVE-2021-37654: TensorFlow out-of-bounds read through tf.raw_ops.ResourceGather

Identifier
CVE-2021-37654
Published
Record updated
View JSON
Affected
  • tensorflow < 2.3.4, fixed in 2.3.4, released August 10, 2021, 3 days before disclosure
  • tensorflow >= 2.4.0, < 2.4.3, fixed in 2.4.3, released August 10, 2021, 3 days before disclosure
  • tensorflow = 2.5.0, fixed in 2.5.1, released August 10, 2021, 3 days before disclosure
  • and 6 more
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.2%

Summary

CVE-2021-37654 affects TensorFlow, an open source machine learning platform. Calling `tf.raw_ops.ResourceGather` with a `batch_dims` value not less than the input tensor's rank can trigger a `CHECK`-fail crash in debug builds, or an out-of-bounds read of heap-allocated data in release builds. The implementation does not validate `batch_dims` against the tensor rank before its loops over the tensor dimensions.

Mitigation

Patched in GitHub commit bc9c546ce7015c57c2f15c168b3d9201de679a1d. The fix will be included in TensorFlow 2.6.0, and the commit will be cherry-picked to TensorFlow 2.5.1, 2.4.3 and 2.3.4.