jq Integer Overflow: Heap Buffer Overflow Risks Untrusted Queries

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 formats

4 auto-generated detection rules for this incident, mapped to MITRE ATT&CK. Available in Sigma, Splunk SPL, Sentinel KQL, Elastic Lucene, and QRadar AQL.

high T1190 Initial Access

Web Application Exploitation Attempt — CVE-2026-32316

Sigma Splunk SPL Sentinel KQL Elastic QRadar AQL

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

IDTypeIndicator
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

Related Posts

Critical RCE Flaw Hits NuGet Gallery Backend

CVE-2026-39399 — NuGet Gallery is a package repository that powers nuget.org. A security vulnerability exists in the NuGetGallery backend job’s handling of .nuspec files within...

vulnerabilityCVEcriticalhigh-severityremote-code-executioncwe-20cwe-22
/CRITICAL /⚑ 4 IOCs

BoidCMS LFI to RCE: A Critical Template Flaw

CVE-2026-39387 — BoidCMS is an open-source, PHP-based flat-file CMS for building simple websites and blogs, using JSON as its database. Versions prior to 2.1.3 are...

vulnerabilityCVEhigh-severityremote-code-executioncwe-98
/HIGH /⚑ 4 IOCs

Nanobot AI: WebSocket Hijack Puts WhatsApp Sessions at Risk

CVE-2026-35589 — nanobot is a personal AI assistant. Versions prior to 0.1.5 contain a Cross-Site WebSocket Hijacking (CSWSH) vulnerability exists in the bridge's WebSocket server...

vulnerabilityCVEhigh-severitycwe-1385
/HIGH /⚑ 5 IOCs