CVE-2021-37646

Source
https://cve.org/CVERecord?id=CVE-2021-37646
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-37646.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-37646
Aliases
Downstream
Related
Published
2021-08-12T21:15:07.983Z
Modified
2026-07-09T10:20:51.985522Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of tf.raw_ops.StringNGrams is vulnerable to an integer overflow issue caused by converting a signed integer value to an unsigned one and then allocating memory based on this value. The implementation calls reserve on a tstring with a value that sometimes can be negative if user supplies negative ngram_widths. The reserve method calls TF_TString_Reserve which has an unsigned long argument for the size of the buffer. Hence, the implicit conversion transforms the negative value to a large integer. We have patched the issue in GitHub commit c283e542a3f422420cfdb332414543b62fc4e4a5. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

References

Affected packages

Git / github.com/tensorflow/tensorflow

Affected ranges

Type
GIT
Repo
https://github.com/tensorflow/tensorflow
Events
Database specific
{
    "cpe": [
        "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
        "cpe:2.3:a:google:tensorflow:2.5.0:*:*:*:*:*:*:*",
        "cpe:2.3:a:google:tensorflow:2.6.0:rc0:*:*:*:*:*:*",
        "cpe:2.3:a:google:tensorflow:2.6.0:rc1:*:*:*:*:*:*",
        "cpe:2.3:a:google:tensorflow:2.6.0:rc2:*:*:*:*:*:*"
    ],
    "extracted_events": [
        {
            "introduced": "2.3.0"
        },
        {
            "fixed": "2.3.4"
        },
        {
            "introduced": "2.4.0"
        },
        {
            "fixed": "2.4.3"
        },
        {
            "introduced": "2.5.0"
        },
        {
            "last_affected": "2.5.0"
        },
        {
            "introduced": "2.6.0-rc0"
        },
        {
            "last_affected": "2.6.0-rc0"
        },
        {
            "introduced": "2.6.0-rc1"
        },
        {
            "last_affected": "2.6.0-rc1"
        },
        {
            "introduced": "2.6.0-rc2"
        },
        {
            "last_affected": "2.6.0-rc2"
        }
    ],
    "source": [
        "CPE_RANGE",
        "CPE_STRING",
        "REFERENCES"
    ]
}

Affected versions

2.*
2.5.0
2.6.0-rc0
2.6.0-rc1
2.6.0-rc2
v2.*
v2.3.0
v2.3.1
v2.3.2
v2.3.3
v2.4.0
v2.4.1
v2.4.2

Database specific

vanir_signatures
[
    {
        "source": "https://github.com/tensorflow/tensorflow/commit/c283e542a3f422420cfdb332414543b62fc4e4a5",
        "signature_version": "v1",
        "signature_type": "Line",
        "digest": {
            "line_hashes": [
                "285621891283101487319147839348099093086",
                "298920372003464589597498879960503880894",
                "276814498817984533453586335083049431762",
                "182428655347205365162753629093306997039"
            ],
            "threshold": 0.9
        },
        "deprecated": false,
        "id": "CVE-2021-37646-f8967422",
        "target": {
            "file": "tensorflow/core/kernels/string_ngrams_op.cc"
        }
    }
]
vanir_signatures_modified
"2026-07-09T10:20:51Z"
source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-37646.json"