{"schema":"/api/v1/schema/cve.json","api_version":"1","id":"CVE-2021-29512","published":"2021-05-14T19:15:07.753000Z","last_modified":"2026-06-17T03:47:48.470000Z","status":"Modified","cvss":{"version":"3.1","score":7.8,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"nvd@nist.gov","primary":true},"auth":true,"cwes":["CWE-120","CWE-787"],"cpes":[{"criteria":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","part":"a","vendor":"google","product":"tensorflow","version_start_including":"2.3.0","version_end_excluding":"2.3.3"},{"criteria":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","part":"a","vendor":"google","product":"tensorflow","version_start_including":"2.4.0","version_end_excluding":"2.4.2"}],"cpes_truncated":false,"vendors":["google"],"products":["google/tensorflow"],"epss":{"score":0.00211,"percentile":0.1197,"date":"2026-12-01","model_version":"v2026.06.15"},"cat":"app","platform":"multi","eol":false,"packages":[{"advisory":"GHSA-4278-2v5v-65r4","ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[{"introduced":"2.3.0","fixed":"2.3.3"}],"versions":["2.3.0","2.3.1","2.3.2"],"versions_truncated":false},{"advisory":"GHSA-4278-2v5v-65r4","ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[{"introduced":"2.4.0","fixed":"2.4.2"}],"versions":["2.4.0","2.4.1"],"versions_truncated":false},{"advisory":"PYSEC-2021-149","ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[{"introduced":"2.3.0","fixed":"2.3.3"},{"introduced":"2.4.0","fixed":"2.4.2"}],"versions":["2.3.0","2.3.1","2.3.2","2.4.0","2.4.1"],"versions_truncated":false},{"advisory":"GHSA-4278-2v5v-65r4","ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[{"introduced":"2.3.0","fixed":"2.3.3"}],"versions":["2.3.0","2.3.1","2.3.2"],"versions_truncated":false},{"advisory":"GHSA-4278-2v5v-65r4","ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[{"introduced":"2.4.0","fixed":"2.4.2"}],"versions":["2.4.0","2.4.1"],"versions_truncated":false},{"advisory":"PYSEC-2021-440","ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[{"introduced":"2.3.0","fixed":"2.3.3"},{"introduced":"2.4.0","fixed":"2.4.2"}],"versions":["2.3.0","2.3.1","2.3.2","2.4.0","2.4.1"],"versions_truncated":false},{"advisory":"GHSA-4278-2v5v-65r4","ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[{"introduced":"2.3.0","fixed":"2.3.3"}],"versions":["2.3.0","2.3.1","2.3.2"],"versions_truncated":false},{"advisory":"GHSA-4278-2v5v-65r4","ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[{"introduced":"2.4.0","fixed":"2.4.2"}],"versions":["2.4.0","2.4.1"],"versions_truncated":false},{"advisory":"PYSEC-2021-638","ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[{"introduced":"2.3.0","fixed":"2.3.3"},{"introduced":"2.4.0","fixed":"2.4.2"}],"versions":["2.3.0","2.3.1","2.3.2","2.4.0","2.4.1"],"versions_truncated":false}],"severity":"high","priority_score":47,"links":{"html_es":"/es/cve/CVE-2021-29512/","html_en":"/en/cve/CVE-2021-29512/","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-29512","cve_org":"https://www.cve.org/CVERecord?id=CVE-2021-29512"},"untrusted":{"vendor_name":"Google","product_name":"Tensorflow","desc_en":"TensorFlow is an end-to-end open source platform for machine learning. If the `splits` argument of `RaggedBincount` does not specify a valid `SparseTensor`(https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor), then an attacker can trigger a heap buffer overflow. This will cause a read from outside the bounds of the `splits` tensor buffer in the implementation of the `RaggedBincount` op(https://github.com/tensorflow/tensorflow/blob/8b677d79167799f71c42fd3fa074476e0295413a/tensorflow/core/kernels/bincount_op.cc#L430-L433). Before the `for` loop, `batch_idx` is set to 0. The user controls the `splits` array, making it contain only one element, 0. Thus, the code in the `while` loop would increment `batch_idx` and then try to read `splits(1)`, which is outside of bounds. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 and TensorFlow 2.3.3, as these are also affected.","affected":[{"untrusted_vendor":"tensorflow","untrusted_product":"tensorflow","versions":[]}],"references":[{"url":"https://github.com/tensorflow/tensorflow/commit/eebb96c2830d48597d055d247c0e9aebaea94cd5","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-4278-2v5v-65r4","tags":["Exploit","Patch","Third Party Advisory"]}]}}