CVE-2021-41215: Null pointer exception in `DeserializeSparse`
5.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.0271%
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:N/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 the shape inference logic in DeserializeSparse's op registration where:
- The original code (pre-patch) only checked that the last dimension was 3 via c->WithValue(c->Dim(c->input(0), -1), 3)
- This would fail catastrophically for rank 0 inputs (scalars) as accessing dimension -1 of a scalar is invalid
- The patch adds c->WithRankAtLeast(c->input(0), 1) to enforce minimum rank
- The CVE description explicitly references this shape inference code path
- The file path and function location match the vulnerability's technical details