GHSA-W4J7-WFGW-R52W
PQC fallback to unauthenticated AES-CTR when GCM fails
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-W4J7-WFGW-R52W 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: CRITICAL
Summary
In `openssl_encrypt/modules/pqc.py` at lines 1400-1444, when AES-GCM decryption fails (authentication error), the code falls back to unauthenticated AES-CTR decryption. This completely strips away the integrity/authentication guarantees of GCM, allowing ciphertext tampering to go undetected.
Affected Code
# pqc.py:1405-1441
try:
if len(ciphertext) > 16:
# Last resort - attempt unauthenticated AES decryption (for testing only)
aes = Cipher(
algorithms.AES(secure_key), modes.CTR(nonce[:16]), backend=None
).decryptor()
plaintext = aes.update(ciphertext) + aes.finalize()
return bytes(secure_plaintext)The comment says "for testing only" but there is no guard preventing this from executing in production.
Impact
An attacker who can modify ciphertext in transit can:
1. Cause GCM authentication to fail (triggering this fallback)
2. Have tampered data decrypted and returned without integrity verification
3. Perform bit-flipping attacks since CTR mode is malleable
Recommended Fix
- Remove the AES-CTR fallback entirely
- When GCM authentication fails, raise an error and refuse to decrypt
---
Resolution
Resolved in commit `6513486` on branch `feature/v1.4.x-development`.
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-w4j7-wfgw-r52wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
