jq Integer Overflow: Heap Buffer Overflow Risks Untrusted Queries
The National Vulnerability Database (NVD) recently detailed CVE-2026-32316, a high-severity integer overflow in jq, the popular command-line JSON processor. This vulnerability, present in versions up to 1.8.1, stems from the jvp_string_append() and jvp_string_copy_replace_bad functions. Essentially, when jq concatenates strings whose combined length exceeds 2^31 bytes, a 32-bit unsigned integer overflow occurs during the buffer allocation size calculation.
This calculation error leads to a drastically undersized heap buffer. Subsequent memory copy operations then attempt to write the full, larger string data into this smaller buffer, triggering a heap-based buffer overflow (CWE-122). The root cause, as highlighted by the NVD, is a glaring absence of string size bounds checking—a safeguard already in place for arrays and objects within jq. Any system parsing untrusted jq queries is vulnerable, opening the door for attackers to crash processes or potentially achieve further exploitation through heap corruption by crafting specific, oversized string queries. The fix has been implemented in commit e47e56d226519635768e6aab2f38f0ab037c09e5.
Related ATT&CK Techniques
🛡️ Detection Rules
4 rules · 5 SIEM formats4 auto-generated detection rules for this incident, mapped to MITRE ATT&CK. Available in Sigma, Splunk SPL, Sentinel KQL, Elastic Lucene, and QRadar AQL.
Web Application Exploitation Attempt — CVE-2026-32316
Get this rule in your SIEM's native format — copy, paste, detect. No manual conversion.
4 Sigma rules mapped to the ATT&CK techniques from this breach — pick your SIEM and get a ready-to-paste query.
Get Detection Rules →Indicators of Compromise
| ID | Type | Indicator |
|---|---|---|
| CVE-2026-32316 | Buffer Overflow | jq software version <= 1.8.1 |
| CVE-2026-32316 | Integer Overflow | jq function jvp_string_append() |
| CVE-2026-32316 | Integer Overflow | jq function jvp_string_copy_replace_bad() |
| CVE-2026-32316 | Heap-based Buffer Overflow | CWE-122 |
| CVE-2026-32316 | Integer Overflow | CWE-190 |