CVE-2022-21731
Python vulnerability analysis and mitigation

Overview

CVE-2022-21731 is a type confusion vulnerability in TensorFlow's shape inference implementation for ConcatV2 operation, discovered in February 2022. The vulnerability affects TensorFlow versions prior to 2.8.0, including versions 2.5.x, 2.6.x, and 2.7.x. This security flaw was reported by Yu Tian of Qihoo 360 AIVul Team (GitHub Advisory).

Technical details

The vulnerability stems from a type confusion in the ConcatShapeHelper function where the axis argument is translated into concatdim. The issue occurs when computing minrank based on concatdim, which is then used to validate the values tensor rank. While WithRankAtLeast receives the lower bound as a 64-bit value and compares it against the maximum 32-bit integer value, the minrank is a 32-bit value. Due to the value of axis, the rank argument becomes negative, allowing the error check to be bypassed (GitHub Advisory). The vulnerability has been assigned a CVSS v3.1 Base Score of 6.5 (Medium) (NVD).

Impact

When exploited, this vulnerability can trigger a denial of service attack through a segmentation fault caused by type confusion. The attack can be initiated by passing specific malicious input to the ConcatV2 operation (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in TensorFlow 2.8.0. Additionally, the fix has been backported to TensorFlow versions 2.7.1, 2.6.3, and 2.5.3. Users are advised to upgrade to these patched versions. The fix was implemented in GitHub commit 08d7b00c0a5a20926363849f611729f53f3ec022 (GitHub Commit, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67511CRITICAL9.6
  • PythonPython
  • cai-framework
NoNoDec 11, 2025
CVE-2025-13780CRITICAL9.1
  • PythonPython
  • cpe:2.3:a:pgadmin:pgadmin
NoYesDec 11, 2025
CVE-2025-67644HIGH7.3
  • PythonPython
  • langgraph-checkpoint-sqlite
NoYesDec 11, 2025
CVE-2025-67720MEDIUM6.5
  • PythonPython
  • pyrofork
NoYesDec 11, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 10, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management