llamaCVEVulnerability Intelligence
/
Advisory · EEF · Hex · idna

EEF-CVE-2026-117678

idna: punycode labels are decoded before the 63-octet length check, so a long xn-- label causes super-linear CPU use

Parche disponible
Descargar PNG JSON
CVSS
—
N/D
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión8.0.0
Exposición1 dDesde la divulgación, 19 nov 2026, 12:36 a. m.
Detección12 minDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada
Verificada
12:36 a. m.
02:00 a. m.
12:44 a. m.
12:36 a. m.
06:38 a. m.
12:40 p. m.
06:42 p. m.
12:44 a. m.
FechaFaseEventoDetalle
Divulgación Publicada EEF-CVE-2026-117678 divulgada
Monitoreo Detectada Ingresó al índice
Divulgación Modificada Última actualización del registro
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · EEF · en inglés

Summary

Inefficient Algorithmic Complexity vulnerability in benoitc idna allows an attacker who controls a hostname passed to the library to exhaust CPU via an over-long `xn--` label. `idna:ulabel/1` in `src/idna.erl` hands every ASCII label that starts with `xn--` to `punycode:decode/1` without applying `check_label_length/1`, the 63-octet DNS label limit. `punycode:decode/1` in `src/punycode.erl` builds its output with list appends in `insert/4`, so its cost grows super-linearly with the label length. A label of a few kilobytes keeps a scheduler busy for seconds to minutes before the label is rejected as invalid punycode.

Every decode entry point reaches this path: `decode/1`, `decode/2`, `to_unicode/1` and `from_ascii/1`. The encode path reaches it as well, because `alabel/1` calls `ulabel/1` on an ASCII `xn--` label before its own length check, so `encode/1`, `encode/2` and `to_ascii/1` are affected for such input.

This issue affects idna: from 0.5.0 before 8.0.0.

Details

1. Label dispatch. `idna:decode/2` in `src/idna.erl` lowercases the domain, splits it into labels and passes each one to `ulabel/1`. For an all-ASCII label that starts with `xn--`, `ulabel/1` strips the prefix and calls `punycode:decode/1` on the remainder. No length check runs before that call. `check_label_length/1`, which rejects labels longer than 63 octets, is only called from `alabel/1`, and there only after `alabel/1` has itself called `ulabel/1` on an ASCII label.

2. Super-linear decoding. `punycode:decode/1` in `src/punycode.erl` decodes one code point per delta and places it into the output with `insert/4`. `insert/4` walks to the insertion index by rebuilding the head with `Head ++ [C]` on every step and then appends the tail with another `++`. Each insertion therefore costs time quadratic in the insertion index, and the total work grows roughly with the cube of the label length. The reporter measured about an 8x increase in running time per doubling of the label.

3. Work before rejection. The crafted label is not valid punycode and the call eventually exits with an error, but only after the decoder has processed the whole label. The `?MAX` overflow guards in `punycode:decode/1` cover the RFC 3492 integer overflow class and do not bound the running time.

4. Entry points. `decode/1`, `decode/2`, `to_unicode/1` and `from_ascii/1` reach `ulabel/1` in every affected release. From 6.0.0, `alabel/1` calls `ulabel/1` on any ASCII label that starts with `xn--` before `check_label_length/1`, so `encode/1`, `encode/2`, `to_ascii/1` and `utf8_to_ascii/1` reach the decoder for such input as well.

Proof of concept

  1. Build an ASCII domain whose label is `xn--` followed by several thousand `a` characters and the digits `99`.
  2. Call `idna:decode/1` on it and measure the call with `timer:tc/1`.
  3. The call exits with an invalid punycode error only after the decoder has processed the whole label. The reporter measured on OTP 27: 506 bytes in 72 ms, 1006 bytes in 494 ms, 2006 bytes in 3.3 s and 4006 bytes in 27.2 s, about 8x per doubling.

Impact

An attacker who can get an application to decode or encode a hostname they control, for example from a user-supplied URL or a redirect `Location` header, keeps one scheduler busy per call for seconds to hours depending on the label length. Enough concurrent calls exhaust the CPU of the VM.

Workarounds

Before passing a hostname to idna, reject any domain that contains a label longer than 63 octets. The DNS limits labels to that length, so legitimate names pass unchanged, and the decoder never runs on the crafted label. The check must run before every call that reaches `idna:ulabel/1`, including `encode/1` and `to_ascii/1`, because `alabel/1` decodes an ASCII `xn--` label before checking its length.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida
idna≥ 0.5.0 < 8.0.0
0.5.0
8.0.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Hexidna
Corregida 8.0.0 — —
Versiones corregidas8.0.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Parchehttps://github.com/benoitc/erlang-idna/pull/45
Parchehttps://github.com/benoitc/erlang-idna/commit/7a465b630eb793556aa7ac282fb73e49251dadd2
Otrahttps://github.com/benoitc/erlang-idna/pull/44
Otrahttps://cna.erlef.org/cves/CVE-2026-117678.html
Otrahttps://github.com/benoitc/erlang-idna/commit/c8caba6653259071f7076fe49320f37402b8b81f
Otrahttps://hex.pm/packages/idna

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.