CVE-2021-29535:
Heap buffer overflow in `QuantizedMul`
2.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.02934%
CWE
Published
5/21/2021
Updated
10/30/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
tensorflow | pip | < 2.1.4 | 2.1.4 |
tensorflow | pip | >= 2.2.0, < 2.2.3 | 2.2.3 |
tensorflow | pip | >= 2.3.0, < 2.3.3 | 2.3.3 |
tensorflow | pip | >= 2.4.0, < 2.4.2 | 2.4.2 |
tensorflow-cpu | pip | < 2.1.4 | 2.1.4 |
tensorflow-cpu | pip | >= 2.2.0, < 2.2.3 | 2.2.3 |
tensorflow-cpu | pip | >= 2.3.0, < 2.3.3 | 2.3.3 |
tensorflow-cpu | pip | >= 2.4.0, < 2.4.2 | 2.4.2 |
tensorflow-gpu | pip | < 2.1.4 | 2.1.4 |
tensorflow-gpu | pip | >= 2.2.0, < 2.2.3 | 2.2.3 |
tensorflow-gpu | pip | >= 2.3.0, < 2.3.3 | 2.3.3 |
tensorflow-gpu | pip | >= 2.4.0, < 2.4.2 | 2.4.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the unvalidated tensor access in QuantizedMulOp::Compute
. The original implementation assumed inputs 2-5 (min/max values) were always valid scalars and accessed their first element via .flat<float>()(0)
. When these tensors are empty (as shown in the PoC), this results in an out-of-bounds buffer access. The patch adds explicit scalar validation via TensorShapeUtils::IsScalar
checks, confirming the root cause was missing input validation in this function
.