Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
7.1

CVE-2022-21731: TensorFlow Machine Learning Framework: Denial of Service Attack

CVE-2022-21731 · published 4 years ago
Summary

TensorFlow's shape inference can be used to crash the system, causing it to become unresponsive. This issue affects users of TensorFlow versions 2.5.0 and later, including versions 2.7.1, 2.6.3, and 2.5.3. To stay secure, update to the latest version, 2.8.0, or apply the patch to the affected versions.

What to do
  • Update google inc. tensorflow to version 2.5.3.
  • Update google inc. tensorflow to version 2.6.3.
  • Update google inc. tensorflow to version 2.7.1.
  • Update google tensorflow-gpu to version 2.5.3.
  • Update google tensorflow-gpu to version 2.6.3.
  • Update google tensorflow-gpu to version 2.7.1.
  • Update google inc. tensorflow-cpu to version 2.5.3.
  • Update google inc. tensorflow-cpu to version 2.6.3.
  • Update google inc. tensorflow-cpu to version 2.7.1.
Affected software
Ecosystem VendorProductAffected versions
pip google inc. tensorflow < 2.5.3
>= 2.6.0, < 2.6.3
2.7.0
Fix: upgrade to 2.5.3
pip google tensorflow-gpu < 2.5.3
>= 2.6.0, < 2.6.3
2.7.0
Fix: upgrade to 2.5.3
pip google inc. tensorflow-cpu < 2.5.3
>= 2.6.0, < 2.6.3
2.7.0
Fix: upgrade to 2.5.3
– google tensorflow <= 2.5.2
>= 2.6.0, <= 2.6.2
2.7.0
cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
Original advisory text
Type confusion leading to segfault in Tensorflow
Tensorflow is an Open Source Machine Learning Framework. The implementation of shape inference for `ConcatV2` can be used to trigger a denial of service attack via a segfault caused by a type confusion. The `axis` argument is translated into `concat_dim` in the `ConcatShapeHelper` helper function. Then, a value for `min_rank` is computed based on `concat_dim`. This is then used to validate that the `values` tensor has at least the required rank. However, `WithRankAtLeast` receives the lower bound as a 64-bits value and then compares it against the maximum 32-bits integer value that could be represented. Due to the fact that `min_rank` is a 32-bits value and the value of `axis`, the `rank` argument is a negative value, so the error check is bypassed. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.
Fix within
Internet-facing 60 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit
  • Gives an attacker partial control
Severity
7.1 High
Exploitation
<1% chance of attack within 30 days
Type
CWE-754Improper Check for Unusual or Exceptional Conditions
CWE-843Type Confusion
Timeline
Published3 Feb 2022
Updated3 Nov 2026
First seen6 Mar 2026
Sources
Track software like this
Free during beta