QID 980181
QID 980181: Python (pip) Security Update for tensorflow-gpu (GHSA-3ff2-r28g-w7h9)
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 [shape inference function for `Transpose`](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/ops/array_ops.cc#L121-L185) is vulnerable to a heap buffer overflow:
```python
import tensorflow as tf
@tf.function
def test():
y = tf.raw_ops.Transpose(x=[1,2,3,4],perm=[-10])
return y
test()
```
This occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid:
```cc
for (int32_t i = 0; i < rank; ++i) {
int64_t in_idx = data[i];
if (in_idx >= rank) {
return errors::InvalidArgument("perm dim ", in_idx,
" is out of range of input rank ", rank);
}
dims[i] = c->Dim(input, in_idx);
}
```
where `Dim(tensor, index)` accepts either a positive index less than the rank of the tensor or the special value `-1` for unknown dimensions.
The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
- GHSA-3ff2-r28g-w7h9 -
github.com/advisories/GHSA-3ff2-r28g-w7h9
CVEs related to QID 980181
| Advisory ID | Software | Component | Link |
|---|---|---|---|
| GHSA-3ff2-r28g-w7h9 | tensorflow |
|
|
| GHSA-3ff2-r28g-w7h9 | tensorflow-cpu |
|
|
| GHSA-3ff2-r28g-w7h9 | tensorflow-gpu |
|