cs01 / cs01/pythonloc

Untrusted arbitrary code execution?

未关闭
#11 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
198
派生
14
PR 合并指标
30 天内没有已合并 PR

描述

Is this expected?

```bash
antoine@elune /tmp/tmp.ucyPsHjPcy/untrusted_code % cat /usr/bin/grep.py
#!/usr/bin/env python3

import os
print('Running grep.')
```

```bash
antoine@elune /tmp/tmp.ucyPsHjPcy/untrusted_code % cat os.py
print('MALICIOUS')
```

```bash
antoine@elune /tmp/tmp.ucyPsHjPcy/untrusted_code % pythonloc /usr/bin/grep.py
MALICIOUS
Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
[...]
AttributeError: module 'os' has no attribute 'path'
```

It doesn't seem reasonable at all to me that running a random script installed on my system with pythonloc would override its libraries with potentially arbitrary code in the directory I'm running the script from.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。