CVE-2021-41205: Heap OOB read in all `tf.raw_ops.QuantizeAndDequantizeV*` ops
7.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.03059%
CWE
Published
11/10/2021
Updated
11/13/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
tensorflow | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
tensorflow | pip | >= 2.5.0, < 2.5.2 | 2.5.2 |
tensorflow | pip | < 2.4.4 | 2.4.4 |
tensorflow-cpu | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
tensorflow-cpu | pip | >= 2.5.0, < 2.5.2 | 2.5.2 |
tensorflow-cpu | pip | < 2.4.4 | 2.4.4 |
tensorflow-gpu | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
tensorflow-gpu | pip | >= 2.5.0, < 2.5.2 | 2.5.2 |
tensorflow-gpu | pip | < 2.4.4 | 2.4.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from shape inference functions in QuantizeAndDequantizeV* ops that only checked for axis != -1 but allowed other negative values. The code attempted to access c->Dim(input, axis) without proper validation of negative axis values, leading to OOB reads. The commit diff shows fixes applied to all four variants (V2, V3, V4, V4Grad) in array_ops.cc by adding explicit checks for axis < -1. Each operation's registration in array_ops.cc contains a shape inference function with this vulnerable pattern, making them clearly identifiable as the root cause.