Executive brief
jq is a widely used command-line tool for processing and transforming JSON data. A vulnerability exists where jq fails to process the entirety of a script file if it contains a hidden 'null' character, causing it to silently ignore any code following that character. This could allow an attacker to bypass security reviews or automated scanners by hiding malicious or unexpected logic in a file that appears benign to other tools.
Technical details
A vulnerability in the top-level program compilation path of jq (specifically when using the -f flag) causes the compiler to truncate the input file at the first embedded NUL (\x00) byte. This occurs because the program data is passed to functions using C-string semantics (strlen) rather than length-aware buffers. An attacker can craft a filter file where a valid prefix is followed by a NUL byte and an arbitrary (even syntactically invalid) suffix; jq will compile and execute only the prefix. This creates a discrepancy between what security tools (like signers or scanners) see in the full file and what jq actually executes. The issue affects versions up to 1.8.1 and current upstream HEAD.
Affected products
- jqlang jq Up to and including 1.8.1
Timeline
- 2026-04-24: advisory: GitHub Security Advisory published by maintainers
- 2026-05-11: disclosed: CVE-2026-41256 published to NVD