CVE-2021-29595

Source
https://cve.org/CVERecord?id=CVE-2021-29595
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-29595.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-29595
Aliases
Published
2021-05-14T20:15:15.207Z
Modified
2026-08-04T15:43:41.267065Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

TensorFlow is an end-to-end open source platform for machine learning. 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/depthtospace.cc#L63-L69). An attacker can craft a model such that params->block_size 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.

Database specific
{
    "unresolved_ranges": [
        {
            "vendor_product": "google:tensorflow",
            "extracted_events": [
                {
                    "fixed": "2.1.4"
                },
                {
                    "introduced": "2.2.0"
                },
                {
                    "fixed": "2.2.3"
                },
                {
                    "introduced": "2.3.0"
                },
                {
                    "fixed": "2.3.3"
                },
                {
                    "introduced": "2.4.0"
                },
                {
                    "fixed": "2.4.2"
                }
            ],
            "cpes": [
                "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*"
            ],
            "source": "CPE_RANGE"
        }
    ]
}
References

Affected packages

Git / github.com/tensorflow/tensorflow

Affected ranges

Type
GIT
Repo
https://github.com/tensorflow/tensorflow
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Database specific
{
    "source": "REFERENCES"
}

Affected versions

0.*
0.5.0
0.6.0
v1.*
v1.1.0-rc1
v1.1.0-rc2
v1.12.1
v1.6.0-rc1
v1.9.0-rc2

Database specific

vanir_signatures
[
    {
        "signature_version": "v1",
        "source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
        "deprecated": false,
        "target": {
            "file": "tensorflow/lite/kernels/depth_to_space.cc",
            "function": "Prepare"
        },
        "id": "CVE-2021-29595-00ab0190",
        "signature_type": "Function",
        "digest": {
            "length": 1231.0,
            "function_hash": "194578451177904327203901424392301025277"
        }
    },
    {
        "signature_version": "v1",
        "source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
        "deprecated": false,
        "target": {
            "file": "tensorflow/lite/kernels/depth_to_space_test.cc"
        },
        "id": "CVE-2021-29595-05dabfa2",
        "signature_type": "Line",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "42775813578012526104495553326850959413",
                "81277890545641336432130271286076822412",
                "108175115334146511382062838843792009128",
                "132316574750375324878129284746562130941"
            ]
        }
    },
    {
        "signature_version": "v1",
        "source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
        "deprecated": false,
        "target": {
            "file": "tensorflow/lite/micro/kernels/depth_to_space.cc",
            "function": "CalculateOpData"
        },
        "id": "CVE-2021-29595-1d4d5d44",
        "signature_type": "Function",
        "digest": {
            "length": 1383.0,
            "function_hash": "301538960950849021820420887459912007271"
        }
    },
    {
        "signature_version": "v1",
        "source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
        "deprecated": false,
        "target": {
            "file": "tensorflow/lite/kernels/depth_to_space.cc"
        },
        "id": "CVE-2021-29595-96920fcc",
        "signature_type": "Line",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "280244985891327533621452415983010945329",
                "210684860855235161399928168550333501251",
                "220239638636039867167793339120456197528",
                "31353712988546551022293633415189149200"
            ]
        }
    },
    {
        "signature_version": "v1",
        "source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
        "deprecated": false,
        "target": {
            "file": "tensorflow/lite/micro/kernels/depth_to_space.cc"
        },
        "id": "CVE-2021-29595-dab8fc78",
        "signature_type": "Line",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "253152061951772719446687539775081213378",
                "339650318467900665491609859073298783004",
                "3403323116876739053804579626699354398",
                "229527051031488281638294414271267640458"
            ]
        }
    }
]
vanir_signatures_modified
"2026-08-04T15:43:41Z"
source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-29595.json"