CVE-2026-43894
JSON

6.2medium

jq: Wild stack write via signed-integer overflow in decNumber D2U() macro

Severity
6.2medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.16% (higher than 5% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

jq is a command-line JSON processor. In 1.8.1 and earlier, when decNumberFromString is given a number literal of INT_MAX-1 (2147483646) digits, the D2U() macro overflows during signed-int arithmetic. The wrapped negative value bypasses the heap-allocation size check, causes the function to use a 30-byte stack buffer, and then writes ≈715 million 16-bit units (≈1.4 GiB) at an offset 1.43 GiB below the stack frame. The written content is fully attacker-controlled (the parsed decimal digits, packed 3-per-unit).

Affected

Product or packageVersionsReported by
jqlang jq<= 1.8.1, up to 1.8.1CVE List, NVD

All scores

GitHub_M6.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-190

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

jq is a command-line JSON processor. In 1.8.1 and earlier, when decNumberFromString is given a number literal of INT_MAX-1 (2147483646) digits, the D2U() macro overflows during signed-int arithmetic. The wrapped negative value bypasses the heap-allocation size check, causes the function to use a 30-byte stack buffer, and then writes ≈715 million 16-bit units (≈1.4 GiB) at an offset 1.43 GiB below the stack frame. The written content is fully attacker-controlled (the parsed decimal digits, packed 3-per-unit).

NVD (es)

jq es un procesador JSON de línea de comandos. En la versión 1.8.1 y anteriores, cuando a decNumberFromString se le proporciona un literal numérico de INT_MAX-1 (2147483646) dígitos, la macro D2U() desborda durante la aritmética de enteros con signo. El valor negativo envuelto omite la comprobación del tamaño de la asignación de memoria dinámica (heap), hace que la función utilice un búfer de pila de 30 bytes y luego escribe ?715 millones de unidades de 16 bits (?1.4 GiB) en un desplazamiento de 1.43 GiB por debajo del marco de pila. El contenido escrito está totalmente controlado por el atacante (los dígitos decimales analizados, empaquetados 3 por unidad).

References

Sources

SourceRecordLicence
CVE ListCVE-2026-43894 changed 2026-05-11CVE Terms of Use
NVDCVE-2026-43894 changed 2026-10-26Public domain