{"id":"CVE-2021-41197","published":"2021-11-05T19:55:36Z","modified":"2024-08-04T03:08:31Z","title":"Crashes due to overflow and `CHECK`-fail in ops with large tensor shapes","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an open source platform for machine learning. In affected versions TensorFlow allows tensor to have a large number of dimensions and each dimension can be as large as desired. However, the total number of elements in a tensor must fit within an `int64_t`. If an overflow occurs, `MultiplyWithoutOverflow` would return a negative result. In the majority of TensorFlow codebase this then results in a `CHECK`-failure. Newer constructs exist which return a `Status` instead of crashing the binary. This is similar to CVE-2021-29584. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00319,"percentile":0.25588,"provenance":"source"},"cwes":[{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-prcg-wp5q-rv7p","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/issues/46890","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/issues/51908","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/7c1692bd417eb4f9b33ead749a41166d6080af85","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/a871989d7b6c18cdebf2fb4f0e5c5b62fbc19edf","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/d81b1351da3e8c884ff836b64458d94e4a157c15","tags":["x_refsource_MISC"]}],"priority":{"score":9.0,"factors":[{"name":"EPSS percentile","points":5.12},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.6.0, < 2.6.1",">= 2.5.0, < 2.5.2","< 2.4.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-prcg-wp5q-rv7p","PYSEC-2021-390"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-prcg-wp5q-rv7p","PYSEC-2021-607"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-prcg-wp5q-rv7p","PYSEC-2021-805"],"provenance":"source"}],"summary":{"text":"The flaw is an integer overflow in TensorFlow's tensor shape handling, where the total element count of a tensor with many or very large dimensions can exceed the range of an int64_t, causing operations to hit a CHECK-failure and crash the process. An attacker with local access and low privileges, and without any user interaction, can crash the affected TensorFlow process by supplying an operation with a tensor shape large enough to trigger the overflow.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:09:56Z"},"euvd":{"id":"EUVD-2021-0420","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2020-15202","parents":[{"from":"CVE-2020-15202","to":"CVE-2021-41197","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/image/crop_and_resize_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/27b417360cbd671ef55915e4bb6bb06af8b8a832","https://github.com/tensorflow/tensorflow/commit/ca8c013b5e97b1373b3bb1c97ea655e69f31a575","https://github.com/tensorflow/tensorflow/commit/7c1692bd417eb4f9b33ead749a41166d6080af85","https://github.com/tensorflow/tensorflow/commit/a871989d7b6c18cdebf2fb4f0e5c5b62fbc19edf"],"basis":"rarely changed file"}]},{"from":"CVE-2020-15266","to":"CVE-2021-41197","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/image/crop_and_resize_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/3ade2efec2e90c6237de32a19680caaa3ebc2845","https://github.com/tensorflow/tensorflow/commit/7c1692bd417eb4f9b33ead749a41166d6080af85","https://github.com/tensorflow/tensorflow/commit/a871989d7b6c18cdebf2fb4f0e5c5b62fbc19edf"],"basis":"rarely changed file"}]},{"from":"CVE-2021-29584","to":"CVE-2021-41197","relation":"related","confidence":"low","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"This is similar to CVE-2021-29584.","from":"CVE.org","in":"CVE-2021-41197"}]}]}}