QID 982504
QID 982504: Python (pip) Security Update for tensorflow-gpu (GHSA-hmg3-c7xj-6qwm)
Security update has been released for tensorflow,tensorflow-cpu,tensorflow-gpu 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.
An attacker can trigger a denial of service via a `CHECK`-fail in converting sparse tensors to CSR Sparse matrices:
```python
import tensorflow as tf
import numpy as np
from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
indices_array = np.array([[0, 0]])
value_array = np.array([0.0], dtype=np.float32)
dense_shape = [0, 0]
st = tf.SparseTensor(indices_array, value_array, dense_shape)
values_tensor = sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix(
st.indices, st.values, st.dense_shape)
```
This is because the [implementation](https://github.com/tensorflow/tensorflow/blob/800346f2c03a27e182dd4fba48295f65e7790739/tensorflow/core/kernels/sparse/kernels.cc#L66) does a double redirection to access an element of an array allocated on the heap:
```cc
csr_row_ptr(indices(i, 0) + 1) += 1;
```
If the value at `indices(i, 0)` is such that `indices(i, 0) + 1` is outside the bounds of `csr_row_ptr`, this results in writing outside of bounds of heap allocated data.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.
- GHSA-hmg3-c7xj-6qwm -
github.com/advisories/GHSA-hmg3-c7xj-6qwm
CVEs related to QID 982504
| Advisory ID | Software | Component | Link |
|---|---|---|---|
| GHSA-hmg3-c7xj-6qwm | tensorflow |
|
|
| GHSA-hmg3-c7xj-6qwm | tensorflow-cpu |
|
|
| GHSA-hmg3-c7xj-6qwm | tensorflow-gpu |
|