cs01 / cs01/pythonloc

Untrusted arbitrary code execution?

Aperta
#11 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
198
Fork
14
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.