Skip to content

Commit 23c05f2

Browse files
authored
add pdsa-2022-002 (#47486) (#47526)
1 parent 5ffd4af commit 23c05f2

File tree

4 files changed

+71
-3
lines changed

4 files changed

+71
-3
lines changed

security/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ We regularly publish security advisories about using PaddlePaddle.
1010
| Advisory Number | Type | Versions affected | Reported by | Additional Information |
1111
|----------------------------------------------|-------------------------|:-----------------:|---------------------------------------|------------------------|
1212
| [PDSA-2022-001](./advisory/pdsa-2022-001.md) | OOB read in gather_tree | < 2.4 | Wang Xuan(王旋) of Qihoo 360 AIVul Team | |
13+
| [PDSA-2022-002](./advisory/pdsa-2022-002.md) | Code injection in paddle.audio.functional.get_window | = 2.4.0-rc0 | Tong Liu of ShanghaiTech University | |

security/README_cn.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
注:我们非常建议飞桨用户阅读和理解[SECURITY_cn.md](../SECURITY_cn.md)所介绍的飞桨安全模型,以便更好地了解此安全公告。
88

99

10-
| 安全公告编号 | 类型 | 受影响版本 | 报告者 | 备注 |
11-
|-------------------------------------------------|-------------------------|:-----:|---------------------------------------| ----------------------|
12-
| [PDSA-2022-001](./advisory/pdsa-2022-001_cn.md) | OOB read in gather_tree | < 2.4 | Wang Xuan(王旋) of Qihoo 360 AIVul Team | |
10+
| 安全公告编号 | 类型 | 受影响版本 | 报告者 | 备注 |
11+
|-------------------------------------------------|-------------------------|:-----:|---------------------------------------|-----|
12+
| [PDSA-2022-001](./advisory/pdsa-2022-001_cn.md) | OOB read in gather_tree | < 2.4 | Wang Xuan(王旋) of Qihoo 360 AIVul Team | |
13+
| [PDSA-2022-002](./advisory/pdsa-2022-002_cn.md) | Code injection in paddle.audio.functional.get_window | = 2.4.0-rc0 | Tong Liu of ShanghaiTech University | |

security/advisory/pdsa-2022-002.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## PDSA-2022-002: Code injection in paddle.audio.functional.get_window
2+
3+
### Impact
4+
5+
`paddle.audio.functional.get_windowis` vulnerable to a code injection as it calls `eval` on user supplied `winstr`. This may lead to arbitrary code execution.
6+
7+
```python
8+
def get_window(
9+
window: Union[str, Tuple[str, float]],
10+
win_length: int,
11+
fftbins: bool = True,
12+
dtype: str = 'float64',
13+
) -> Tensor:
14+
...
15+
try:
16+
winfunc = eval('_' + winstr)
17+
except NameError as e:
18+
raise ValueError("Unknown window type.") from e
19+
```
20+
21+
### Patches
22+
23+
We have patched the issue in commit [26c419ca386aeae3c461faf2b828d00b48e908eb](https://github.com/PaddlePaddle/Paddle/commit/26c419ca386aeae3c461faf2b828d00b48e908eb).
24+
25+
The fix will be included in PaddlePaddle 2.4.
26+
27+
### For more information
28+
29+
Please consult [our security guide](../../SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.
30+
31+
### Attribution
32+
33+
This vulnerability has been reported by Tong Liu of ShanghaiTech University.

security/advisory/pdsa-2022-002_cn.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## PDSA-2022-002: Code injection in paddle.audio.functional.get_window
2+
3+
### 影响
4+
5+
`paddle.audio.functional.get_window`由于使用`eval`用户提供的参数`winstr`而存在代码注入漏洞,将导致任意代码执行。
6+
7+
```python
8+
def get_window(
9+
window: Union[str, Tuple[str, float]],
10+
win_length: int,
11+
fftbins: bool = True,
12+
dtype: str = 'float64',
13+
) -> Tensor:
14+
...
15+
try:
16+
winfunc = eval('_' + winstr)
17+
except NameError as e:
18+
raise ValueError("Unknown window type.") from e
19+
```
20+
21+
### 补丁
22+
23+
我们在commit [26c419ca386aeae3c461faf2b828d00b48e908eb](https://github.com/PaddlePaddle/Paddle/commit/26c419ca386aeae3c461faf2b828d00b48e908eb)中对此问题进行了补丁。
24+
25+
修复将包含在飞桨2.4版本当中。
26+
27+
### 更多信息
28+
29+
请参考我们的[安全指南](../../SECURITY_cn.md)以获得更多关于安全的信息,以及如何与我们联系问题。
30+
31+
### 贡献者
32+
33+
此漏洞由 Tong Liu of ShanghaiTech University 提交。

0 commit comments

Comments
 (0)