GHSA-43R4-3HF9-M84Q
restore_hidden_modules() logging bug and race condition in import guard
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-43R4-3HF9-M84Q 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
Two issues exist in the `PluginImportGuard` in `openssl_encrypt/modules/plugin_system/plugin_sandbox.py` at lines 96-117.
Issue 1: Logging Bug (line 117)
`restore_hidden_modules()` logs the count after `self.hidden_modules.clear()` has been called (line 116), so the log message always shows "Restored 0 hidden modules", destroying audit trail evidence.
Issue 2: Race Condition
`hide_dangerous_modules()` only hides modules currently in `sys.modules`. There is a window between removing modules from `sys.modules` and installing the import hook where another thread could re-import a blocked module.
Impact
- Audit trail corruption — security events appear to show zero modules were restored
- In multi-threaded environments, blocked modules could be accessed during the race window
Recommended Fix
- Log the count before clearing: `count = len(self.hidden_modules)` then clear, then log count
- Use a lock around the hide/restore operations to prevent race conditions
Fix
Fixed in commit `85cdb6b` on branch `releases/1.4.x` — captured module count before clear(); added threading.Lock for thread safety; wrapped restoration in try/finally.
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-43r4-3hf9-m84qLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
