CVE-2026-39979
jq: out-of-bounds read in jv_parse_sized() on error formatting for non-NUL-terminated buffers
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · April 14, 2026
Updated · October 2, 2026
Description
A flaw was found in jq, a command line JSON processor, specifically in the libjq API. Parsing a malformed JSON input from a non-NUL-terminated buffer using the jv_parse_sized function can cause an out-of-bounds read, resulting in an application crash and a possible memory disclosure within the error message generated by the parser.
Statement
To exploit this flaw, an attacker needs to supply malformed JSON from a non-NUL-terminated buffer to an application using the jv_parse_sized function. This allows the attacker to trigger the out-of-bounds read, causing an application crash and potentially disclosing memory with no other security impact. As this issue affects the libjq library, it is more likely to be exposed to untrusted input. Due to these reasons, this vulnerability has been rated with an important severity.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this issue, manually ensure that every buffer is NUL-terminated before passing it to the 'jv_parse_sized' function.
CVSS / CWE
CVSS 3.1 · 8.2CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
CWE-125 · Out-of-bounds Read