CVE-2022-21733: Memory exhaustion in Tensorflow
4.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.44736%
CWE
Published
2/10/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:N/I:N/A:L
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 the StringNGramsOp's Compute function in string_ngrams_op.cc. The code path handling preserve_short_sequences=True with empty ngram_widths used pad_width without proper validation. The patch added an explicit check (OP_REQUIRES) for pad_width >=0 in this context. The original code allowed negative pad_width values, which when combined with data_length in ngram_width calculation (data_length + 2*pad_width), could produce invalid values used for memory allocation. The function's direct role in processing these parameters and the explicit fix in the commit confirm this as the vulnerable location.