PyPI: tensorflow-gpu

CVE-2021-29595

Safety vulnerability ID: SFTY-20210514-68932

Safety legacy ID: pyup.io-56228

Tensorflow-gpu 2.1.4, 2.2.3, 2.3.3, 2.4.2, and 2.5.0 include a fix for CVE-2021-29595: The implementation of the `DepthToSpace` TFLite operator is vulnerable to a division by zero error (https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/depth_to_space.cc#L63-L69). An attacker can craft a model such that `params->block_size` is 0.

Created at: Jul 5, 2026Updated at: Jul 5, 2026

Overview

Division by zero in TFLite's implementation of `DepthToSpace`

Advisory

Tensorflow-gpu 2.1.4, 2.2.3, 2.3.3, 2.4.2, and 2.5.0 include a fix for CVE-2021-29595: The implementation of the `DepthToSpace` TFLite operator is vulnerable to a division by zero error (https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/depth_to_space.cc#L63-L69). An attacker can craft a model such that `params->block_size` is 0.

Affected Package

Affecting tensorflow-gpu package, versions>=2.5.0rc0,<2.5.0>=2.4.0rc0,<2.4.2>=2.2.0rc0,<2.2.3>=2.1.0rc0,<2.1.4>=2.3.0rc0,<2.3.3

Also affects

---

How to Fix

Upgradetensorflow-gputo2.5.02.4.22.2.32.1.42.3.3or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more