GHSA-9PM7-8F77-4MQ9
Quadratic parse time of long header field values in eml_parser before 4.1.0
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 4.1.0 | eml-parser · -37 d desde divulgación | |
| Divulgación | Publicada | GHSA-9PM7-8F77-4MQ9 divulgada · CVSS 6.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
eml_parser before 4.1.0 runs every header field value through the structured header parsers of the Python standard library, whose running time is quadratic in the length of the value. One long header field (any name, e.g. `Received`, `Subject` or an `X-` field) makes the parse of a message take seconds to minutes.
### Details
Measured on eml_parser 3.0.6, the last 3.x release, with one header field of nested comments with white space (`( ( ... ) )`): 125 KiB took 1.1 s, 250 KiB 3.3 s and 500 KiB 11.8 s of CPU time (growth exponent 1.6 to 1.8). Other header names behave alike (250 KiB: 2.1 to 3.5 s). A message of many such fields adds up: 25 MiB of 8 KiB `Received` fields took 195 s. The cost is in the stdlib parser, not in the removal of comments, which has been linear since 3.0.2 (CVE-2026-55620).
Since 4.1.0, values longer than 8 KiB (`constants.MAX_PARSED_HEADER_SIZE`) are not run through the stdlib parsers; since 4.3.0 the structured parsing per message is also limited to 10 000 fields and 2 MiB of values. With 4.7.1, the same tests took at most 9 s for 25 MiB of `Received` fields, growing linearly with the size.
### Impact
CPU exhaustion of the process parsing a crafted message, for as long as that message is parsed. The impact depends on the size of header fields the pipeline accepts: many mail servers limit the size of the header, which bounds the cost, while files parsed from other sources may carry fields of any size.
### Patches
Fixed in 4.1.0. The 3.x line receives no further releases; upgrade to 4.1.0 or later (current: 4.7.1).
### Workarounds
Limit the size of header fields before parsing (e.g. in the mail server), or parse messages with a time limit.
### Credits
Reported by @lanjianchun.
### References
- GHSA-g7gc-gmgp-wgqg / CVE-2026-55620 (linear removal of comments in `Received` fields since 3.0.2)
- Changelog of eml_parser 4.1.0 ("Fix headers with huge values taking minutes to parse")
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypieml-parser |
Corregida | 4.1.0 | -37 d | 4.7.0 no afectada |
4.1.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/GOVCERT-LU/eml_parser/security/advisories/GHSA-9pm7-8f77-4mq9Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
