CVE-2022-21731

Source
https://cve.org/CVERecord?id=CVE-2022-21731
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21731.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-21731
Aliases
Downstream
Related
Published
2022-02-03T11:37:56Z
Modified
2026-04-11T18:44:59.410700Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Type confusion leading to segfault in Tensorflow
Details

Tensorflow is an Open Source Machine Learning Framework. The implementation of shape inference for ConcatV2 can be used to trigger a denial of service attack via a segfault caused by a type confusion. The axis argument is translated into concat_dim in the ConcatShapeHelper helper function. Then, a value for min_rank is computed based on concat_dim. This is then used to validate that the values tensor has at least the required rank. However, WithRankAtLeast receives the lower bound as a 64-bits value and then compares it against the maximum 32-bits integer value that could be represented. Due to the fact that min_rank is a 32-bits value and the value of axis, the rank argument is a negative value, so the error check is bypassed. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21731.json",
    "cna_assigner": "GitHub_M"
}
References

Affected packages

Git / github.com/tensorflow/tensorflow

Affected ranges

Type
GIT
Repo
https://github.com/tensorflow/tensorflow
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
Introduced
Last affected
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
Fixed
Database specific
{
    "versions": [
        {
            "introduced": "0"
        },
        {
            "last_affected": "2.5.2"
        },
        {
            "introduced": "2.6.0"
        },
        {
            "last_affected": "2.6.2"
        },
        {
            "introduced": "0"
        },
        {
            "last_affected": "2.7.0"
        }
    ]
}

Affected versions

0.*
0.5.0
0.6.0
v1.*
v1.1.0-rc1
v1.1.0-rc2
v1.12.1
v1.6.0-rc1
v1.9.0-rc2
v2.*
v2.5.0
v2.5.0-rc0
v2.5.0-rc1
v2.5.0-rc2
v2.5.0-rc3
v2.5.1
v2.5.2
v2.6.0
v2.6.1
v2.6.2
v2.7.0
v2.7.0-rc0
v2.7.0-rc1

Database specific

vanir_signatures_modified
"2026-04-11T18:44:59Z"
vanir_signatures
[
    {
        "deprecated": false,
        "source": "https://github.com/tensorflow/tensorflow/commit/08d7b00c0a5a20926363849f611729f53f3ec022",
        "signature_version": "v1",
        "signature_type": "Line",
        "target": {
            "file": "tensorflow/core/framework/common_shape_fns.cc"
        },
        "digest": {
            "line_hashes": [
                "194785652992784543577633290733112157758",
                "172650984985865334530168716989985892621",
                "22086933652431354182808201152422042306",
                "199826184584423699519732742679653515330"
            ],
            "threshold": 0.9
        },
        "id": "CVE-2022-21731-7a4f35b0"
    }
]
source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21731.json"