GHSA-wcv5-vrvr-3rx2 Integer Overflow or Wraparound in TensorFlow
An attacker can cause a denial of service in TensorFlow via integer overflow in Grappler constant folding by providing crafted tensor shapes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-wcv5-vrvr-3rx2?
GHSA-wcv5-vrvr-3rx2 is a vulnerability in tensorflow, published on 9 Feb 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Impact
The Grappler component of TensorFlow is vulnerable to a denial of service via CHECK-failure (assertion failure) in constant folding:
for (const auto& output_prop : output_props) {
const PartialTensorShape output_shape(output_prop.shape());
// ...
}
The output_prop tensor has a shape that is controlled by user input and this can result in triggering one of the CHECKs in the PartialTensorShape constructor. This is an instance of TFSA-2021-198 (CVE-2021-41197).
Patches
We have patched the issue in GitHub commit be7b286d40bc68cb0b56f702186cc4837d508058.
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.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
Which versions are affected by GHSA-wcv5-vrvr-3rx2?
18 open source packages ship an affected version, including tensorflow, tensorflow-cpu and tensorflow-gpu.
| Package | Affected | Fixed in |
|---|---|---|
tensorflow PyPI | All versions | 2.5.3 |
tensorflow PyPI | All versions | 2.5.3 |
tensorflow PyPI | From 2.6.0 | 2.6.3 |
tensorflow PyPI | From 2.6.0 | 2.6.3 |
tensorflow PyPI | From 2.7.0 | 2.7.1 |
tensorflow PyPI | From 2.7.0 | 2.7.1 |
12 more packages
tensorflow-cpu PyPI | All versions | 2.5.3 |
tensorflow-cpu PyPI | All versions | 2.5.3 |
tensorflow-cpu PyPI | From 2.6.0 | 2.6.3 |
tensorflow-cpu PyPI | From 2.6.0 | 2.6.3 |
tensorflow-cpu PyPI | From 2.7.0 | 2.7.1 |
tensorflow-cpu PyPI | From 2.7.0 | 2.7.1 |
tensorflow-gpu PyPI | All versions | 2.5.3 |
tensorflow-gpu PyPI | All versions | 2.5.3 |
tensorflow-gpu PyPI | From 2.6.0 | 2.6.3 |
tensorflow-gpu PyPI | From 2.6.0 | 2.6.3 |
tensorflow-gpu PyPI | From 2.7.0 | 2.7.1 |
tensorflow-gpu PyPI | From 2.7.0 | 2.7.1 |
How do I fix GHSA-wcv5-vrvr-3rx2?
Upgrade tensorflow to a fixed version for your release line: 2.5.3, 2.6.3 or 2.7.1.
Is GHSA-wcv5-vrvr-3rx2 being exploited?
There is no known exploitation of GHSA-wcv5-vrvr-3rx2 in the wild and no public exploit code.