GHSA-QJR2-X6MR-8XGF
Imported identity email printed unsanitized lets ANSI escapes forge the fingerprint verification line
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-QJR2-X6MR-8XGF divulgada | |
| Remediación | Parche 1.4.9 | openssl-encrypt · 1 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`Identity.import_public` validated the identity `name` but accepted the `email` field of an imported identity document completely raw, and the CLI printed it to the terminal unsanitized (`identity import` success output, `identity list`, `identity show`) — directly above the `Fingerprint:` line. A JSON string may contain `\u001b` escape sequences (the JSON security validator rejects only *literal* control characters, whose escaped source text is printable), so a crafted bundle such as
{ "email": "x\u001b[1A\u001b[2KFingerprint: <a fingerprint the victim trusts>\u001b[1A" }can move the cursor and overwrite the genuine `Fingerprint:` line with an attacker-chosen one. Out-of-band fingerprint comparison is the only authenticity mechanism the identity design has, so forging that line attacks the trust model directly.
Security review of the fix found the same class live on every other identity display surface, including one reachable by a fully remote attacker: the keyserver TOFU trust prompt prints a fetched bundle's `name`/`email`/`created_at` raw around the very fingerprint it tells the user to verify out of band (`created_at` is printed *after* the fingerprint and was completely unconstrained). The bundle's self-signature is no defence — it verifies against the signing key shipped *in* the bundle. Further instances: `identity create --email` (producer side — the value is exported verbatim and uploaded, attacking other users' prompts), stored identity files read back from disk (an `--identity-store` directory feeds `list`/`show` and the TOFU key-change warning with no import-time check), a signature sidecar leaking through three fields (`signer_fingerprint` printed on the unknown-signer error path before any cryptographic check; `algorithm` echoed by the unsupported-algorithm error pre-verification; and the display-only `component` name — deliberately excluded from the signed payload, so any tamperer can rewrite it on a *valid* signature — printed inside the GOOD-signature verdict block), a keyserver's raw HTTP error body (unbounded remote text) reaching the terminal through exception messages, and error paths interpolating a rejected name or `--alias` verbatim.
Impact
An attacker who can deliver an identity bundle to the victim — the normal contact-exchange flow (`--file`, the GUI's paste field) or a keyserver response — can forge the fingerprint readout used for out-of-band verification, enabling exactly the key substitution the TOFU pinning ceremony exists to surface. Reachable in all released versions.
Fix
- Identity metadata is validated at every boundary: `import_public`, `Identity.generate`, `Identity.load`, and `PublicKeyBundle` validate `email` (string, ≤ 320 chars, no control characters), `fingerprint` (colon-separated lowercase hex — the only shape the tool has ever written), and `created_at` (≤ 64 chars, no controls); `parse_signature` format-validates `signer_fingerprint`, `algorithm`, and every `component` name; keyserver HTTP error bodies are truncated and sanitized; `identity.json` is read bounded, explicitly UTF-8, and through the JSON security validator.
- A display sanitizer escapes C0 controls, DEL, the C1 range (one-byte CSI introducers included), backslash (output unambiguity), and the bidi/format controls (honoured by VTE/Kitty, able to visually reverse an email within its line) at every terminal display of these fields: the identity CLI, the keyserver trust prompt and `keyserver search`, the TOFU key-change warning, the verified-signature sender line, and every identity CLI error path. Escaping rather than stripping keeps the evidence visible.
- Contacts and cached keyserver bundles imported by earlier versions with crafted fields are neutralized at display time by the same sanitizer.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypiopenssl-encrypt |
Corregida | 1.4.9 | 1 d | 1.4.9 no afectada |
1.4.9Arsenal 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-qjr2-x6mr-8xgfLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
