2.5low
Division by zero in TFLite's implementation of `TransposeConv`
- Severity
- 2.5low CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.20% (higher than 10% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-vfr4-x8j2-3rf9BIT-TENSORFLOW-2021-29588PYSEC-2021-225PYSEC-2021-516PYSEC-2021-714
Description
TensorFlow is an end-to-end open source platform for machine learning. The optimized implementation of the `TransposeConv` TFLite operator is [vulnerable to a division by zero error](https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L5221-L5222). An attacker can craft a model such that `stride_{h,w}` values are 0. Code calling this function must validate these arguments. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| tensorflow tensorflow | < 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2 | CVE List |
| tensorflow (PyPI) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2, before 801c1c6be5324219689c98e1bd3e0ca365ee834d | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-cpu (PyPI) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2, before 801c1c6be5324219689c98e1bd3e0ca365ee834d | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-gpu (PyPI) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2, before 801c1c6be5324219689c98e1bd3e0ca365ee834d | GitHub Advisory Database, PyPA Advisory Database |
| google tensorflow | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2 | NVD |
| tensorflow (Bitnami) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 4.6medium CVSS:2.0 | AV:L/AC:L/Au:N/C:P/I:P/A:P |
| Bitnami Vulnerability Database | high rating |
Classification
What each source says
CVE List
TensorFlow is an end-to-end open source platform for machine learning. The optimized implementation of the `TransposeConv` TFLite operator is [vulnerable to a division by zero error](https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L5221-L5222). An attacker can craft a model such that `stride_{h,w}` values are 0. Code calling this function must validate these arguments. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.
GitHub Advisory Database
Impact
The optimized implementation of the TransposeConv TFLite operator is vulnerable to a division by zero error:
int height_col = (height + pad_t + pad_b - filter_h) / stride_h + 1;
int width_col = (width + pad_l + pad_r - filter_w) / stride_w + 1;
An attacker can craft a model such that stride_{h,w} values are 0. Code calling this function must validate these arguments.
Patches
We have patched the issue in GitHub commit 801c1c6be5324219689c98e1bd3e0ca365ee834d.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, 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.
Attribution
This vulnerability has been reported by members of the Aivul Team from Qihoo 360.
NVD (es)
TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático. La implementación optimizada del operador TFLite "TransposeConv" es [vulnerable a un error de división por cero] (https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/internal/optimized/optimized#L5221-L5222). Un atacante puede diseñar un modelo tal que los valores de "stride_ {h, w}" sean 0. El código que llama a esta función debe comprobar estos argumentos. La corrección será incluida en TensorFlow versión 2.5.0. También seleccionaremos este commit en TensorFlow versión 2.4.2, TensorFlow versión 2.3.3, TensorFlow versión 2.2.3 y TensorFlow versión 2.1.4, ya que estos también están afectados y aún están en el rango compatible
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29588 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-vfr4-x8j2-3rf9 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29588 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-225 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2021-516 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2021-714 changed 2023-12-06 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2021-29588 changed 2026-09-08 | Apache-2.0 |