REDHAT-BUG-2469175: Medium severity JQ jq vulnerability
jq is a command-line JSON processor. In 1.8.1 and earlier, when decNumberFromString is given a number literal of INTMAX-1 (2147483646) digits, the D2U() macro overflows during signed-int arithmetic. The wrapped negative value bypasses the heap-allocation size check, causes the function to use a 30-byte stack buffer, and then writes ≈715 million 16-bit units (≈1.4 GiB) at an offset 1.43 GiB below the stack frame. The written content is fully attacker-controlled (the parsed decimal digits, packed 3-per-unit).
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Deployments using jq 1.8.1 or earlier are exposed when they parse attacker-controlled JSON that can contain an extremely large numeric literal. The triggering literal must contain 2,147,483,646 digits.
What must an attacker provide to trigger the vulnerability?
An attacker needs to cause jq to process a JSON number literal with exactly INT_MAX-1, or 2,147,483,646, decimal digits. The decimal digits written during parsing are attacker-controlled.
How can I identify potentially affected usage?
Check whether jq is version 1.8.1 or earlier and whether it processes JSON from untrusted sources. Inputs containing numeric literals approaching 2,147,483,646 digits are the relevant indicator.
What can be done before updating jq?
Prevent untrusted JSON from reaching jq, or reject numeric literals with extremely large digit counts before jq parses them. This avoids the specified triggering condition.