CVE-2021-41211: Heap OOB in shape inference for `QuantizeV2`
7.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.03322%
CWE
Published
11/10/2021
Updated
11/7/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 |
tensorflow-cpu | pip | = 2.6.0 | 2.6.1 |
tensorflow-gpu | pip | = 2.6.0 | 2.6.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the QuantizeV2 shape inference function's handling of the 'axis' parameter. The original code (before patch) only checked if axis != -1 but didn't validate against values < -1. This allowed attackers to specify invalid negative axes that underflow the valid dimension index range. The function directly uses the unvalidated 'axis' value in c->Dim(input, axis), which when negative beyond -1, translates to an invalid positive index via dims() + axis + 1 calculation, causing OOB access. The patch explicitly adds the 'axis < -1' check, confirming this as the root cause.