Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-41211

TensorFlow is an open source platform for machine learning. In affected versions the shape inference code for `QuantizeV2` can trigger a read outside of bounds of heap allocated array. This occurs whenever `axis` is a negative value less than `-1`. In this case, we are accessing data before the start of a heap buffer. The code allows `axis` to be an optional argument (`s` would contain an `error::NOT_FOUND` error code). Otherwise, it assumes that `axis` is a valid index into the dimensions of the `input` tensor. If `axis` is less than `-1` then this results in a heap OOB read. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, as this version is the only one that is also affected.

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

Source evidence

CVE-2021-41211

core-osv · Original source

Published 5 Nov 2021, 21:15 UTC

TensorFlow is an open source platform for machine learning. In affected versions the shape inference code for `QuantizeV2` can trigger a read outside of bounds of heap allocated array. This occurs whenever `axis` is a negative value less than `-1`. In this case, we are accessing data before the start of a heap buffer. The code allows `axis` to be an optional argument (`s` would contain an `error::NOT_FOUND` error code). Otherwise, it assumes that `axis` is a valid index into the dimensions of the `input` tensor. If `axis` is less than `-1` then this results in a heap OOB read. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, as this version is the only one that is also affected.

osv:CVE-2021-41211
Complete source record
{
  "id": "f89fd35e79d8e09d6d45605ecd74a4eeb6392cf256b38f7f68f5eca2d24db15a",
  "url": "https://osv.dev/vulnerability/CVE-2021-41211",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-41211",
    "summary": "TensorFlow is an open source platform for machine learning. In affected versions the shape inference code for `QuantizeV2` can trigger a read outside of bounds of heap allocated array. This occurs whenever `axis` is a negative value less than `-1`. In this case, we are accessing data before the start of a heap buffer. The code allows `axis` to be an optional argument (`s` would contain an `error::NOT_FOUND` error code). Otherwise, it assumes that `axis` is a valid index into the dimensions of the `input` tensor. If `axis` is less than `-1` then this results in a heap OOB read. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, as this version is the only one that is also affected.",
    "evidence": "osv:CVE-2021-41211",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-41211",
      "aliases": [
        "BIT-tensorflow-2021-41211",
        "CVE-2021-41211",
        "GHSA-cvgx-3v3q-m36c",
        "PYSEC-2021-403",
        "PYSEC-2021-620",
        "PYSEC-2021-818"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/tensorflow/tensorflow",
              "type": "GIT",
              "events": [
                {
                  "introduced": "919f693420e35d00c8d0a42100837ae3718f7927"
                },
                {
                  "last_affected": "919f693420e35d00c8d0a42100837ae3718f7927"
                },
                {
                  "fixed": "a0d64445116c43cf46a5666bd4eee28e7a82f244"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:2.6.0:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.6.0"
                      },
                      {
                        "last_affected": "2.6.0"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "a0d64445116c43cf46a5666bd4eee28e7a82f244"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.6.0",
            "v2.6.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41211.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-41211-ada5e2e5",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "292019307657172673815772274943963559087",
                    "212291911477907925029921727066780418712",
                    "292246294375621615880694698843490059734",
                    "268139264183951617846274770393293014309"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/a0d64445116c43cf46a5666bd4eee28e7a82f244",
                "target": {
                  "file": "tensorflow/core/framework/common_shape_fns.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-41211-c58c33cd",
                "digest": {
                  "length": 753,
                  "function_hash": "76831370271156220449637595622773750089"
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/a0d64445116c43cf46a5666bd4eee28e7a82f244",
                "target": {
                  "file": "tensorflow/core/framework/common_shape_fns.cc",
                  "function": "QuantizeV2Shape"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:10:50Z"
          }
        }
      ],
      "modified": "2026-10-20T14:10:50.761968024Z",
      "provider": "osv",
      "references": [
        "https://github.com/tensorflow/tensorflow/commit/a0d64445116c43cf46a5666bd4eee28e7a82f244",
        "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-cvgx-3v3q-m36c"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-41211",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 388664,
  "published_at": "2021-11-05T21:15:08.813+00:00"
}