Crashes due to overflow and `CHECK`-fail in ops with large tensor shapes
tensorflow
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| tensorflow PyPI |
|
|
tensorflow
| Product | Affected | Fixed in |
|---|---|---|
| tensorflow PyPI |
|
|
| tensorflow-cpu PyPI |
|
|
| tensorflow-gpu PyPI |
|
|
TensorFlow is an open source platform for machine learning. In affected versions TensorFlow allows tensor to have a large number of dimensions and each dimension can be as large as desired. However, the total number of elements in a tensor must fit within an `int64_t`. If an overflow occurs, `MultiplyWithoutOverflow` would return a negative result. In the majority of TensorFlow codebase this then results in a `CHECK`-failure. Newer constructs exist which return a `Status` instead of crashing the binary. This is similar to CVE-2021-29584. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
From the CVE record · GitHub_M
Affected TensorFlow packages can overflow when calculating the total number of elements in a tensor with large dimensions. If an attacker can cause such a tensor to be processed, the overflow can trigger a check failure that crashes the process. The input does not specify whether exploitation requires network access, authentication, or user interaction.
Teams using PyPI tensorflow, tensorflow-cpu, or tensorflow-gpu versions below 2.4.4, from 2.5.0 to before 2.5.2, from 2.6.0 to before 2.6.1, or from 2.7.0rc0 to before 2.7.0 should check their installations.