GHSA-MCJJ-QW7M-J3CP
pathlib.Path and io.open bypass sandbox builtins.open restriction
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-MCJJ-QW7M-J3CP divulgada | |
| Remediación | Parche 1.4.0 | openssl_encrypt · 21 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Severity: HIGH
Summary
The sandbox in `openssl_encrypt/modules/plugin_system/plugin_sandbox.py` at lines 412-440 restricts file access by overriding `builtins.open` with `restricted_open`. However, it does NOT restrict alternative file access methods.
Bypass Methods
The following are not restricted by the sandbox or blocked by the import guard:
- `pathlib.Path.read_text()` / `Path.read_bytes()`
- `pathlib.Path.write_text()` / `Path.write_bytes()`
- `pathlib.Path.open()`
- `io.open()`
The AST analyzer does not block `pathlib` or `io` imports.
Proof of Concept
from pathlib import Path
data = Path('/etc/passwd').read_text()Impact
File access restrictions are trivially bypassed when the import guard is active (threading mode). In the default process isolation mode, there are no restrictions at all (see GHSA-623h-chj7-hfx8).
Recommended Fix
- Add `pathlib` and `io` to the import guard's blocked modules, or
- Override `pathlib.Path.open`, `pathlib.Path.read_text`, etc. in the sandbox setup
- Consider OS-level filesystem restrictions (chroot, namespaces) instead of Python-level hooks
Fix
Fixed in commit `d0be3e9` on branch `releases/1.4.x` — added pathlib and io to BLOCKED_MODULES; monkey-patched pathlib.Path file methods and io.open to route through restricted_open.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypiopenssl_encrypt |
Corregida | 1.4.0 | 21 d | 1.4.9 no afectada |
1.4.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-mcjj-qw7m-j3cpLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
