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/depth_to_space.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.
{
"extracted_events": [
{
"cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "2.1.4"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.2.3"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.3.0"
},
{
"fixed": "2.3.3"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.4.0"
},
{
"fixed": "2.4.2"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "106d8f4fb89335a2c52d7c895b7a7485465ca8d9"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-29595.json"
[
{
"deprecated": false,
"digest": {
"function_hash": "194578451177904327203901424392301025277",
"length": 1231
},
"id": "CVE-2021-29595-00ab0190",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
"target": {
"file": "tensorflow/lite/kernels/depth_to_space.cc",
"function": "Prepare"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"42775813578012526104495553326850959413",
"81277890545641336432130271286076822412",
"108175115334146511382062838843792009128",
"132316574750375324878129284746562130941"
],
"threshold": 0.9
},
"id": "CVE-2021-29595-05dabfa2",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
"target": {
"file": "tensorflow/lite/kernels/depth_to_space_test.cc"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "301538960950849021820420887459912007271",
"length": 1383
},
"id": "CVE-2021-29595-1d4d5d44",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
"target": {
"file": "tensorflow/lite/micro/kernels/depth_to_space.cc",
"function": "CalculateOpData"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"280244985891327533621452415983010945329",
"210684860855235161399928168550333501251",
"220239638636039867167793339120456197528",
"31353712988546551022293633415189149200"
],
"threshold": 0.9
},
"id": "CVE-2021-29595-96920fcc",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
"target": {
"file": "tensorflow/lite/kernels/depth_to_space.cc"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"253152061951772719446687539775081213378",
"339650318467900665491609859073298783004",
"3403323116876739053804579626699354398",
"229527051031488281638294414271267640458"
],
"threshold": 0.9
},
"id": "CVE-2021-29595-dab8fc78",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/tensorflow/tensorflow/commit/106d8f4fb89335a2c52d7c895b7a7485465ca8d9",
"target": {
"file": "tensorflow/lite/micro/kernels/depth_to_space.cc"
}
}
]
"2026-10-16T08:07:58Z"