QID 981515
QID 981515: Python (pip) Security Update for tensorflow-gpu (GHSA-h6jh-7gv5-28vg)
Security update has been released for tensorflow-gpu,tensorflow,tensorflow-cpu to fix the vulnerability.
Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.
The implementation of `tf.raw_ops.StringNGrams` is vulnerable to an integer overflow issue caused by converting a signed integer value to an unsigned one and then allocating memory based on this value.
```python
import tensorflow as tf
tf.raw_ops.StringNGrams(
data=[','],
data_splits=[0,2],
separator=' '*100,
ngram_widths=[-80,0,0,-60],
left_pad=' ',
right_pad=' ',
pad_width=100,
preserve_short_sequences=False)
```
The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/string_ngrams_op.cc#L184) calls `reserve` on a `tstring` with a value that sometimes can be negative if user supplies negative `ngram_widths`. The `reserve` method calls `TF_TString_Reserve` which has an `unsigned long` argument for the size of the buffer. Hence, the implicit conversion transforms the negative value to a large integer.
The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.
- GHSA-h6jh-7gv5-28vg -
github.com/advisories/GHSA-h6jh-7gv5-28vg
CVEs related to QID 981515
| Advisory ID | Software | Component | Link |
|---|---|---|---|
| GHSA-h6jh-7gv5-28vg | tensorflow |
|
|
| GHSA-h6jh-7gv5-28vg | tensorflow-cpu |
|
|
| GHSA-h6jh-7gv5-28vg | tensorflow-gpu |
|