CVE-2026-33948
JSON

2.9low

jq: Embedded-NUL Truncation in CLI JSON Input Path Causes Prefix-Only Validation of Malformed Input

Severity
2.9low CVSS:4.0 by GitHub_M
Exploit likelihood
0.27% (higher than 20% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

jq is a command-line JSON processor. Commits before 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b contain a vulnerability where CLI input parsing allows validation bypass via embedded NUL bytes. When reading JSON from files or stdin, jq uses strlen() to determine buffer length instead of the actual byte count from fgets(), causing it to truncate input at the first NUL byte and parse only the preceding prefix. This enables an attacker to craft input with a benign JSON prefix before a NUL byte followed by malicious trailing data, where jq validates only the prefix as valid JSON while silently discarding the suffix. Workflows relying on jq to validate untrusted JSON before forwarding it to downstream consumers are susceptible to parser differential attacks, as those consumers may process the full input including the malicious trailing bytes. This issue has been patched by commit 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b.

Affected

Product or packageVersionsReported by
jqlang jq< 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b, before 1.8.2CVE List, NVD

All scores

GitHub_M2.9low CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-20CWE-170

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

What each source says

CVE List

jq is a command-line JSON processor. Commits before 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b contain a vulnerability where CLI input parsing allows validation bypass via embedded NUL bytes. When reading JSON from files or stdin, jq uses strlen() to determine buffer length instead of the actual byte count from fgets(), causing it to truncate input at the first NUL byte and parse only the preceding prefix. This enables an attacker to craft input with a benign JSON prefix before a NUL byte followed by malicious trailing data, where jq validates only the prefix as valid JSON while silently discarding the suffix. Workflows relying on jq to validate untrusted JSON before forwarding it to downstream consumers are susceptible to parser differential attacks, as those consumers may process the full input including the malicious trailing bytes. This issue has been patched by commit 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b.

NVD (es)

jq es un procesador JSON de línea de comandos. Commits anteriores a 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b contienen una vulnerabilidad donde el análisis de entrada CLI permite eludir la validación a través de bytes NUL incrustados. Al leer JSON de archivos o stdin, jq usa strlen() para determinar la longitud del búfer en lugar del recuento real de bytes de fgets(), lo que hace que trunque la entrada en el primer byte NUL y analice solo el prefijo precedente. Esto permite a un atacante crear una entrada con un prefijo JSON benigno antes de un byte NUL seguido de datos maliciosos al final, donde jq valida solo el prefijo como JSON válido mientras descarta silenciosamente el sufijo. Los flujos de trabajo que dependen de jq para validar JSON no confiable antes de reenviarlo a consumidores posteriores son susceptibles a ataques diferenciales de analizador, ya que esos consumidores pueden procesar la entrada completa, incluidos los bytes maliciosos finales. Este problema ha sido parcheado por el commit 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-33948 changed 2026-04-14CVE Terms of Use
NVDCVE-2026-33948 changed 2026-10-26Public domain