Untrusted arbitrary code execution?
- Lenguaje dominante
- Python
- Estrellas
- 198
- Forks
- 14
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Reproduce el comportamiento usando pythonloc con /usr/bin/grep.py y el os.py local mostrado en el informe. Lee el punto de entrada de pythonloc para el inicio y la gestión de imports, y después establece y prueba el comportamiento en el que un script instalado en el sistema no pueda verse afectado inesperadamente por módulos del directorio actual.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- cli, security
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100