{"id":"CVE-2021-29578","published":"2021-05-14T19:15:54Z","modified":"2024-08-03T22:11:05Z","title":"Heap buffer overflow in `FractionalAvgPoolGrad`","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. The implementation of `tf.raw_ops.FractionalAvgPoolGrad` is vulnerable to a heap buffer overflow. The implementation(https://github.com/tensorflow/tensorflow/blob/dcba796a28364d6d7f003f6fe733d82726dda713/tensorflow/core/kernels/fractional_avg_pool_op.cc#L216) fails to validate that the pooling sequence arguments have enough elements as required by the `out_backprop` tensor shape. 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.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00211,"percentile":0.11519,"provenance":"source"},"cwes":[{"id":"CWE-119","name":"Improper Restriction of Operations within the Bounds of a Memory Buffer"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-6f89-8j54-29xf","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/12c727cee857fa19be717f336943d95fca4ffe4f","tags":["x_refsource_MISC"]}],"priority":{"score":4.1,"factors":[{"name":"EPSS percentile","points":2.3},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.1.4",">= 2.2.0, < 2.2.3",">= 2.3.0, < 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-6f89-8j54-29xf","PYSEC-2021-215"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-6f89-8j54-29xf","PYSEC-2021-506"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-6f89-8j54-29xf","PYSEC-2021-704"],"provenance":"source"}],"summary":{"text":"A heap buffer overflow in TensorFlow's tf.raw_ops.FractionalAvgPoolGrad implementation arises because it does not check that the pooling sequence arguments contain enough elements for the out_backprop tensor shape. An attacker with local access and low privileges, who can get the affected code to run with crafted input, can cause a denial of service through the memory corruption, and the attack is considered high complexity.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:22:40Z"},"euvd":{"id":"EUVD-2021-0319","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29578","children":[{"from":"CVE-2021-29578","to":"CVE-2021-37651","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/fractional_avg_pool_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/12c727cee857fa19be717f336943d95fca4ffe4f","https://github.com/tensorflow/tensorflow/commit/0f931751fb20f565c4e94aa6df58d54a003cdb30"],"basis":"shared function","functions":["FractionalAvgPoolGradOp"]}]},{"from":"CVE-2021-29578","to":"CVE-2022-21730","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/fractional_avg_pool_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/12c727cee857fa19be717f336943d95fca4ffe4f","https://github.com/tensorflow/tensorflow/commit/002408c3696b173863228223d535f9de72a101a9"],"basis":"shared function","functions":["FractionalAvgPoolGradOp"]}]},{"from":"CVE-2021-29578","to":"CVE-2022-35963","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/fractional_avg_pool_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/12c727cee857fa19be717f336943d95fca4ffe4f","https://github.com/tensorflow/tensorflow/commit/03a659d7be9a1154fdf5eeac221e5950fec07dad"],"basis":"shared function","functions":["FractionalAvgPoolGradOp"]}]}]}}