CVE-2022-21728: Out of bounds read in Tensorflow
8.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.76722%
CWE
Published
2/9/2022
Updated
11/13/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/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.5.3 | 2.5.3 |
tensorflow | pip | >= 2.6.0, < 2.6.3 | 2.6.3 |
tensorflow | pip | = 2.7.0 | 2.7.1 |
tensorflow-cpu | pip | < 2.5.3 | 2.5.3 |
tensorflow-cpu | pip | >= 2.6.0, < 2.6.3 | 2.6.3 |
tensorflow-cpu | pip | = 2.7.0 | 2.7.1 |
tensorflow-gpu | pip | < 2.5.3 | 2.5.3 |
tensorflow-gpu | pip | >= 2.6.0, < 2.6.3 | 2.6.3 |
tensorflow-gpu | pip | = 2.7.0 | 2.7.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key points: 1) ReverseSequence's shape inference in array_ops.cc only checks upper bounds of batch_dim but allows negative values without validation. 2) DimKnownRank in shape_inference.h implements Python-style negative indexing but doesn't validate that 'idx >= -dims_.size()'. Together, when given a large negative batch_dim (e.g., -10 for a rank 2 tensor), DimKnownRank computes an invalid index (2 + (-10) = -8) leading to OOB read. The commit 37c01fb fixes this by adding explicit batch_dim >= 0 check in ReverseSequence's shape inference.