CVE-2026-121577 Complejidad de expresión regular ineficiente en generate_regex() de whatstk
En whatstk desde 0.2.0 hasta antes de 0.9.0, generate_regex() en whatstk/whatsapp/parser.py construye la expresión regular de encabezado sin escapar los separadores del formato, por lo que un separador que sea metacaracter de expresión regular altera el patrón. Un chat exportado con ese encabezado puede consumir la CPU del proceso que lo parsea por tiempo indefinido. La detección automática de encabezado está habilitada por defecto.
CVSS 4.0
- Probabilidad de explotación · EPSS del 09/110,1 % · percentil 2
- Explotada activamenteNo confirmada
- Exploit públicoNo conocido
Afectados
lucasrodes whatstk
desde 0.2.0 hasta antes de 0.9.0
Qué hacer
- Verificá si usás whatstk y en qué versión.
- Actualizá a la versión corregida que indique el fabricante en su aviso o aplicá su mitigación.
- Revisá registros y accesos de los sistemas expuestos para descartar un uso previo.
Calculadora CVSS
CVSS 4.0 · 6.7 MEDIA
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- Vector de ataqueLocal
- Complejidad del ataqueBaja
- Requisitos del ataqueNinguno
- Privilegios requeridosNinguno
- Interacción del usuarioActiva
- Confidencialidad (sistema vulnerable)Ninguna
- Integridad (sistema vulnerable)Ninguna
- Disponibilidad (sistema vulnerable)Alta
- Confidencialidad (sistemas posteriores)Ninguna
- Integridad (sistemas posteriores)Ninguna
- Disponibilidad (sistemas posteriores)Ninguna
Descripción original
Inefficient Regular Expression Complexity (CWE-1333) in generate_regex() (whatstk/whatsapp/parser.py) in whatstk from 0.2.0 before 0.9.0 allows a party that supplies a chat export to consume the CPU of the process that parses it for an unbounded time, because the function builds the header regular expression by replacing each %x code with its named capture group and leaves every other character of the header format in the pattern unescaped. A header whose date separator is a regular expression metacharacter therefore alters the pattern instead of matching itself: a separator of + quantifies the preceding capture group, giving (?P<day>\d{1,2})+(?P<month>\d{1,2})+(?P<year>\d{2,4}), and a run of digits that cannot complete the header then makes the engine try every way of partitioning that run. Header auto detection is enabled by default and derives the format from the text of the file, so the separator is taken from the export itself and no header format has to be passed by the caller. Separators of (, ) and \ instead raise re.PatternError, separators of *, | and ? raise TypeError, and separators of ^ and $ raise KeyError, none of which the library catches. This results in the parse of a file of a few hundred bytes consuming CPU without completing, or in an uncaught exception in the calling program.
Referencias (4)
Resumen traducido automáticamente de la descripción original. Fuente: Nureq Monitor. Cómo funciona.