{"cve":"CVE-2021-29571","nvd":{"published":"2021-05-14T20:15:13.877","modified":"2026-06-17T03:47:56.093","status":"Modified","description":"TensorFlow is an end-to-end open source platform for machine learning. The implementation of `tf.raw_ops.MaxPoolGradWithArgmax` can cause reads outside of bounds of heap allocated data if attacker supplies specially crafted inputs. The implementation(https://github.com/tensorflow/tensorflow/blob/31bd5026304677faa8a0b77602c6154171b9aec1/tensorflow/core/kernels/image/draw_bounding_box_op.cc#L116-L130) assumes that the last element of `boxes` input is 4, as required by [the op](https://www.tensorflow.org/api_docs/python/tf/raw_ops/DrawBoundingBoxesV2). Since this is not checked attackers passing values less than 4 can write outside of bounds of heap allocated objects and cause memory corruption. If the last dimension in `boxes` is less than 4, accesses similar to `tboxes(b, bb, 3)` will access data outside of bounds. Further during code execution there are also writes to these indices. 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.","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"],"references":["https://github.com/tensorflow/tensorflow/commit/79865b542f9ffdc9caeb255631f7c56f1d4b6517","https://github.com/tensorflow/tensorflow/security/advisories/GHSA-whr9-vfh2-7hm6","https://github.com/tensorflow/tensorflow/commit/79865b542f9ffdc9caeb255631f7c56f1d4b6517","https://github.com/tensorflow/tensorflow/security/advisories/GHSA-whr9-vfh2-7hm6"],"products":["google:tensorflow"],"source":"nvd","synced_at":"2026-10-19T21:18:09.669877188+00:00"},"epss":{"cve":"CVE-2021-29571","score":0.0024,"percentile":0.15145,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-whr9-vfh2-7hm6","url":"https://osv.dev/vulnerability/GHSA-whr9-vfh2-7hm6","summary":"Memory corruption in `DrawBoundingBoxesV2`","modified":"2026-07-08T06:27:25.544570231Z","packages":[{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":["<2.1.4"],"fixed":["2.1.4"]},{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":[">=2.2.0 <2.2.3"],"fixed":["2.2.3"]},{"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.1.4"],"fixed":["2.1.4"]},{"ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":[">=2.2.0 <2.2.3"],"fixed":["2.2.3"]},{"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.1.4"],"fixed":["2.1.4"]},{"ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":[">=2.2.0 <2.2.3"],"fixed":["2.2.3"]},{"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-208","url":"https://osv.dev/vulnerability/PYSEC-2021-208","summary":"","modified":"2023-12-06T01:01:06.778678Z","packages":[{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":["<2.2.0rc0",">=2.2.0 <2.3.0rc0",">=2.3.0 <2.3.4",">=2.4.0 <2.4.3"],"fixed":["2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"]}]},{"id":"PYSEC-2021-499","url":"https://osv.dev/vulnerability/PYSEC-2021-499","summary":"","modified":"2023-12-06T01:01:06.778678Z","packages":[{"ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":["<2.2.0rc0",">=2.2.0 <2.3.0rc0",">=2.3.0 <2.3.4",">=2.4.0 <2.4.3"],"fixed":["2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"]}]},{"id":"PYSEC-2021-697","url":"https://osv.dev/vulnerability/PYSEC-2021-697","summary":"","modified":"2023-12-06T01:01:06.778678Z","packages":[{"ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":["<2.2.0rc0",">=2.2.0 <2.3.0rc0",">=2.3.0 <2.3.4",">=2.4.0 <2.4.3"],"fixed":["2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"]}]}],"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."]}