Quick answers
- Is CVE-2021-41198 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-41198 being exploited in the wild.
- How severe is CVE-2021-41198?
- Low severity, with a CVSS score of 3.1, published 5 November 2021.
- Which products and versions are affected?
- Google TensorFlow before 2.4.4, 2.5.0-2.5.1, 2.6.0; tensorflow (PyPI) GIT:introduced=0,fixed=9294094df6fea79271778eb7e7ae1bad8b5ef98f|ECOSYSTEM:introduced=0,fixed=2.4.4,introduced=2.5.0,fixed=2.5.2,introduced=2.6.0,fixed=2.6.1,introduced=2.7.0rc0,fixed=2.7.0; tensorflow-cpu (PyPI) GIT:introduced=0,fixed=9294094df6fea79271778eb7e7ae1bad8b5ef98f|ECOSYSTEM:introduced=0,fixed=2.4.4,introduced=2.5.0,fixed=2.5.2,introduced=2.6.0,fixed=2.6.1,introduced=2.7.0rc0,fixed=2.7.0; tensorflow-gpu (PyPI) GIT:introduced=0,fixed=9294094df6fea79271778eb7e7ae1bad8b5ef98f|ECOSYSTEM:introduced=0,fixed=2.4.4,introduced=2.5.0,fixed=2.5.2,introduced=2.6.0,fixed=2.6.1,introduced=2.7.0rc0,fixed=2.7.0.
- Is there a fix for CVE-2021-41198?
- Yes. tensorflow (PyPI): upgrade to 2.7.0 or later; tensorflow-cpu (PyPI): upgrade to 2.7.0 or later; tensorflow-gpu (PyPI): upgrade to 2.7.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2021-41198 attacked?
- It is attacked with local access.
- Am I affected by CVE-2021-41198?
- Check whether you run Google TensorFlow, tensorflow (PyPI), tensorflow-cpu (PyPI) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- tensorflow (PyPI): upgrade to 2.7.0 or later
pip install "tensorflow>=2.7.0" - tensorflow-cpu (PyPI): upgrade to 2.7.0 or later
pip install "tensorflow-cpu>=2.7.0" - tensorflow-gpu (PyPI): upgrade to 2.7.0 or later
pip install "tensorflow-gpu>=2.7.0"
Technical details
The vulnerability is an integer overflow (CWE-190) in TensorFlow's tf.tile function. When tf.tile is called with large input dimensions, the computation of the output tensor size overflows the int64_t type. The overflow is detected via a CHECK statement that aborts the process rather than gracefully handling the condition. An attacker who can invoke tf.tile with crafted tensor dimensions (e.g., np.ones((1,1,1)) tiled by [100000000, 100000000, 100000000]) triggers an immediate denial of service. No special privileges or authentication are required if the attacker has local code execution or can submit jobs to a shared TensorFlow service. The fix was applied in commit 9294094df6fea79271778eb7e7ae1bad8b5ef98f and backported to versions 2.4.4, 2.5.2, 2.6.1, and included in 2.7.0.
Affected products
- Google TensorFlow before 2.4.4, 2.5.0-2.5.1, 2.6.0
- Google TensorFlow CPU before 2.4.4, 2.5.0-2.5.1, 2.6.0
- Google TensorFlow GPU before 2.4.4, 2.5.0-2.5.1, 2.6.0
Identifiers
- CVE-2021-41198
- GHSA-2p25-55c9-h58q
- PYSEC-2021-391
- PYSEC-2021-608
- PYSEC-2021-806
Timeline
- 2021-11-10: disclosed: GHSA-2p25-55c9-h58q published
- 2021-11: patched: Patches released in TensorFlow 2.4.4, 2.5.2, 2.6.1 and 2.7.0