{"cve":"CVE-2021-29512","nvd":{"published":"2021-05-14T19:15:07.753","modified":"2026-06-17T03:47:48.470","status":"Modified","description":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8},"cwes":["CWE-787","CWE-120"],"references":["https://github.com/tensorflow/tensorflow/commit/eebb96c2830d48597d055d247c0e9aebaea94cd5","https://github.com/tensorflow/tensorflow/security/advisories/GHSA-4278-2v5v-65r4","https://github.com/tensorflow/tensorflow/commit/eebb96c2830d48597d055d247c0e9aebaea94cd5","https://github.com/tensorflow/tensorflow/security/advisories/GHSA-4278-2v5v-65r4"],"products":["google:tensorflow"],"source":"nvd","synced_at":"2026-10-19T21:18:09.669877188+00:00"},"epss":{"cve":"CVE-2021-29512","score":0.00211,"percentile":0.11335,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-4278-2v5v-65r4","url":"https://osv.dev/vulnerability/GHSA-4278-2v5v-65r4","summary":"Heap buffer overflow in `RaggedBinCount`","modified":"2026-07-08T06:27:44.269149911Z","packages":[{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[">=2.3.0 <2.3.3"],"fixed":["2.3.3"]},{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[">=2.4.0 <2.4.2"],"fixed":["2.4.2"]},{"ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[">=2.3.0 <2.3.3"],"fixed":["2.3.3"]},{"ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[">=2.4.0 <2.4.2"],"fixed":["2.4.2"]},{"ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[">=2.3.0 <2.3.3"],"fixed":["2.3.3"]},{"ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[">=2.4.0 <2.4.2"],"fixed":["2.4.2"]}]},{"id":"PYSEC-2021-149","url":"https://osv.dev/vulnerability/PYSEC-2021-149","summary":"","modified":"2023-12-06T01:01:03.193626Z","packages":[{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[">=2.3.0 <2.3.3",">=2.4.0 <2.4.2"],"fixed":["2.3.3","2.4.2"]}]},{"id":"PYSEC-2021-440","url":"https://osv.dev/vulnerability/PYSEC-2021-440","summary":"","modified":"2023-12-06T01:01:03.193626Z","packages":[{"ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[">=2.3.0 <2.3.3",">=2.4.0 <2.4.2"],"fixed":["2.3.3","2.4.2"]}]},{"id":"PYSEC-2021-638","url":"https://osv.dev/vulnerability/PYSEC-2021-638","summary":"","modified":"2023-12-06T01:01:03.193626Z","packages":[{"ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[">=2.3.0 <2.3.3",">=2.4.0 <2.4.2"],"fixed":["2.3.3","2.4.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}