Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-41197

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-41197
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:52 UTC · Revision 1

Source evidence

CVE-2021-41197

core-osv · Original source

Published 5 Nov 2021, 20:15 UTC

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.

osv:CVE-2021-41197
Complete source record
{
  "id": "104af3336b131a72dcc9c66ab363a41b3e33b0071d8cb9f0b0403324b1348969",
  "url": "https://osv.dev/vulnerability/CVE-2021-41197",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-41197",
    "summary": "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.",
    "evidence": "osv:CVE-2021-41197",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-41197",
      "aliases": [
        "BIT-tensorflow-2021-41197",
        "CVE-2021-41197",
        "GHSA-prcg-wp5q-rv7p",
        "PYSEC-2021-390",
        "PYSEC-2021-607",
        "PYSEC-2021-805"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/tensorflow/tensorflow",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "64918868e2154b06c7479347a59a4230f785e9fa"
                },
                {
                  "introduced": "a4dfb8d1a71385bd6d122e4f27f86dcebb96712d"
                },
                {
                  "fixed": "957590ea15cc03ee2e00fc61934647d54836676f"
                },
                {
                  "introduced": "919f693420e35d00c8d0a42100837ae3718f7927"
                },
                {
                  "fixed": "3aa40c3ce9d16eae296f086bc4ac4d62deb2affc"
                },
                {
                  "fixed": "7c1692bd417eb4f9b33ead749a41166d6080af85"
                },
                {
                  "fixed": "a871989d7b6c18cdebf2fb4f0e5c5b62fbc19edf"
                },
                {
                  "fixed": "d81b1351da3e8c884ff836b64458d94e4a157c15"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.4.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.5.0"
                      },
                      {
                        "fixed": "2.5.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.6.0"
                      },
                      {
                        "fixed": "2.6.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "7c1692bd417eb4f9b33ead749a41166d6080af85"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "a871989d7b6c18cdebf2fb4f0e5c5b62fbc19edf"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "d81b1351da3e8c884ff836b64458d94e4a157c15"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v2.4.3",
            "v2.6.0",
            "v2.5.1",
            "v2.4.2",
            "v2.5.0",
            "v2.4.1",
            "v2.4.0",
            "v2.4.0-rc4",
            "v2.4.0-rc3",
            "v2.4.0-rc2",
            "v2.4.0-rc1",
            "v2.4.0-rc0",
            "v1.12.1",
            "v1.9.0-rc2",
            "v1.6.0-rc1",
            "v1.1.0-rc2",
            "v1.1.0-rc1",
            "0.6.0",
            "0.5.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41197.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-41197-f6bc942d",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "42795263024984423624926971837916551934",
                    "13532178865317665393472696422922917660",
                    "156707645268049010351338601456752360242",
                    "72290359874600724834031106757411916812",
                    "211182006161367615459096447041420945882",
                    "148330600700220778300832497172674476596",
                    "183831544294558903313234623575991556759",
                    "101203200858936987590069393974601614668",
                    "62585205114489691939117322564232267194",
                    "273962130279930228499662932836880494181",
                    "30728997932805413783458550563079851490",
                    "132112781087479837852411540596373570415",
                    "46911155122571014711201278463802840516",
                    "72290359874600724834031106757411916812",
                    "324907275937687112786027944199451717445",
                    "45220747313414774855918620724129273306",
                    "252278347851652841546370509008305337149",
                    "14916289529172078412108663024784862892",
                    "324132783673330951234037652456139297196",
                    "25397842174317544629428580468998276064"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/7c1692bd417eb4f9b33ead749a41166d6080af85",
                "target": {
                  "file": "tensorflow/core/kernels/image/crop_and_resize_op.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:28:22Z"
          }
        }
      ],
      "modified": "2026-10-20T14:28:22.355404539Z",
      "provider": "osv",
      "references": [
        "https://github.com/tensorflow/tensorflow/commit/7c1692bd417eb4f9b33ead749a41166d6080af85",
        "https://github.com/tensorflow/tensorflow/commit/a871989d7b6c18cdebf2fb4f0e5c5b62fbc19edf",
        "https://github.com/tensorflow/tensorflow/commit/d81b1351da3e8c884ff836b64458d94e4a157c15",
        "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-prcg-wp5q-rv7p",
        "https://github.com/tensorflow/tensorflow/issues/46890",
        "https://github.com/tensorflow/tensorflow/issues/51908"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-41197",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 389049,
  "published_at": "2021-11-05T20:15:07.843+00:00"
}