{"id":"CVE-2021-29580","published":"2021-05-14T19:15:43Z","modified":"2024-08-03T22:11:06Z","title":"Undefined behavior and `CHECK`-fail in `FractionalMaxPoolGrad`","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.FractionalMaxPoolGrad` triggers an undefined behavior if one of the input tensors is empty. The code is also vulnerable to a denial of service attack as a `CHECK` condition becomes false and aborts the process. The implementation(https://github.com/tensorflow/tensorflow/blob/169054888d50ce488dfde9ca55d91d6325efbd5b/tensorflow/core/kernels/fractional_max_pool_op.cc#L215) fails to validate that input and output tensors are not empty and are of the same rank. Each of these unchecked assumptions is responsible for the above issues. 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.00189,"percentile":0.08721,"provenance":"source"},"cwes":[{"id":"CWE-908","name":"Use of Uninitialized Resource"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-x8h6-xgqx-jqgp","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/32fdcbff9d06d010d908fcc4bd4b36eb3ce15925","tags":["x_refsource_MISC"]}],"priority":{"score":3.5,"factors":[{"name":"EPSS percentile","points":1.74},{"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-x8h6-xgqx-jqgp","PYSEC-2021-217"],"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-x8h6-xgqx-jqgp","PYSEC-2021-508"],"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-x8h6-xgqx-jqgp","PYSEC-2021-706"],"provenance":"source"}],"summary":{"text":"The flaw is in TensorFlow's tf.raw_ops.FractionalMaxPoolGrad operation, in its implementation in the fractional max pool kernel, which fails to validate that input and output tensors are non-empty and of the same rank. An attacker who can get the operation to run with one of its input tensors empty can trigger undefined behavior and a CHECK failure that aborts the process, causing a denial of service; this requires local access with low privileges and high attack complexity, with no user interaction needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:11Z"},"euvd":{"id":"EUVD-2021-0321","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29580","children":[{"from":"CVE-2021-29580","to":"CVE-2022-35981","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/fractional_max_pool_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/32fdcbff9d06d010d908fcc4bd4b36eb3ce15925","https://github.com/tensorflow/tensorflow/commit/8741e57d163a079db05a7107a7609af70931def4"],"basis":"shared function","functions":["FractionalMaxPoolGradOp"]}]},{"from":"CVE-2021-29580","to":"CVE-2022-41897","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/fractional_max_pool_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/32fdcbff9d06d010d908fcc4bd4b36eb3ce15925","https://github.com/tensorflow/tensorflow/commit/d71090c3e5ca325bdf4b02eb236cfb3ee823e927"],"basis":"shared function","functions":["FractionalMaxPoolGradOp"]}]}]}}