CVE-2021-29597
Description
TensorFlow is an end-to-end open source platform for machine learning. The implementation of the `SpaceToBatchNd` TFLite operator is [vulnerable to a division by zero error](https://github.com/tensorflow/tensorflow/blob/412c7d9bb8f8a762c5b266c9e73bfa165f29aac8/tensorflow/lite/kernels/space_to_batch_nd.cc#L82-L83). An attacker can craft a model such that one dimension of the `block` input is 0. Hence, the corresponding value in `block_shape` is 0. 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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
Vendor advisory: debian — https://security-tracker.debian.org/tracker/CVE-2021-29597
OS impact
| OS | Version | Status | Fixed in |
|---|---|---|---|
| arch | fixed | 2.5.0-1 | |
| debian | forky | fixed | 0 |
| debian | sid | fixed | 0 |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| PyPI | tensorflow | <2.1.4 | 2.1.4 |
| PyPI | tensorflow | >=2.2.0,<2.2.3 | 2.2.3 |
| PyPI | tensorflow | >=2.3.0,<2.3.3 | 2.3.3 |
| PyPI | tensorflow | >=2.4.0,<2.4.2 | 2.4.2 |
| PyPI | tensorflow-cpu | <2.1.4 | 2.1.4 |
| PyPI | tensorflow-cpu | >=2.2.0,<2.2.3 | 2.2.3 |
| PyPI | tensorflow-cpu | >=2.3.0,<2.3.3 | 2.3.3 |
| PyPI | tensorflow-cpu | >=2.4.0,<2.4.2 | 2.4.2 |
| PyPI | tensorflow-gpu | <2.1.4 | 2.1.4 |
| PyPI | tensorflow-gpu | >=2.2.0,<2.2.3 | 2.2.3 |
| PyPI | tensorflow-gpu | >=2.3.0,<2.3.3 | 2.3.3 |
| PyPI | tensorflow-gpu | >=2.4.0,<2.4.2 | 2.4.2 |
| PyPI | tensorflow | <6d36ba65577006affb272335b7c1abd829010708||>=2.4.0,<2.4.2 | 6d36ba65577006affb272335b7c1abd829010708 |
| PyPI | tensorflow-cpu | <6d36ba65577006affb272335b7c1abd829010708||>=2.4.0,<2.4.2 | 6d36ba65577006affb272335b7c1abd829010708 |
| PyPI | tensorflow-gpu | <6d36ba65577006affb272335b7c1abd829010708||>=2.4.0,<2.4.2 | 6d36ba65577006affb272335b7c1abd829010708 |
References
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-v52p-hfjf-wg88
- https://nvd.nist.gov/vuln/detail/CVE-2021-29597
- https://github.com/tensorflow/tensorflow/commit/6d36ba65577006affb272335b7c1abd829010708
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-525.yaml
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-723.yaml
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-234.yaml
- https://github.com/tensorflow/tensorflow
- https://github.com/tensorflow/tensorflow/blob/412c7d9bb8f8a762c5b266c9e73bfa165f29aac8/tensorflow/lite/kernels/space_to_batch_nd.cc#L82-L83
- https://security-tracker.debian.org/tracker/CVE-2021-29597
Verify integrity in audit chain (admin only). AS-IS.