REDHAT-BUG-2458038: Medium severity JQ jq vulnerability

Published Apr 13, 2026
·
Updated

jq is a command-line JSON processor. In versions 1.8.1 and below, functions jvsetpath(), jvgetpath(), and delpathssorted() in jq's src/jvaux.c use unbounded recursion whose depth is controlled by the length of a caller-supplied path array, with no depth limit enforced. An attacker can supply a JSON document containing a flat array of ~65,000 integers (~200 KB) that, when used as a path argument by a trusted jq filter, exhausts the C call stack and crashes the process with a segmentation fault (SIGSEGV). This bypass works because the existing MAXPARSINGDEPTH (10,000) limit only protects the JSON parser, not runtime path operations where arrays can be programmatically constructed to arbitrary lengths. The impact is denial of service (unrecoverable crash) affecting any application or service that processes untrusted JSON input through jq's setpath, getpath, or delpaths builtins. This issue has been addressed in commit fb59f1491058d58bdc3e8dd28f1773d1ac690a1f.

Affected Software

1 affected component
JQ jq<=1.8.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch fb59f1491058d58bdc3e8dd28f1773d1ac690a1f

Event History

Apr 13, 2026
Data Sourced
via Red Hat·10:01 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is realistically exposed to this denial-of-service issue?

Applications or services that process untrusted JSON with jq filters using the setpath, getpath, or delpaths builtins are affected. The risk is greatest where an attacker can influence the path array directly or cause the filter to construct an arbitrarily long path array from supplied input.

2

Does jq's existing parsing-depth limit prevent this crash?

No. MAX_PARSING_DEPTH limits JSON parser nesting depth, but it does not limit the depth of runtime path operations, including arrays programmatically constructed by a jq filter.

3

What input is needed to trigger the crash?

An attacker needs a caller-supplied path array long enough to drive unbounded recursion in the affected path functions. The provided example is a flat array of roughly 65,000 integers, about 200 KB, used as a path argument by a trusted jq filter.

4

How can we tell whether an application may be affected?

Review jq filters and calling code for use of setpath, getpath, or delpaths with path arrays derived from untrusted JSON or constructed without a length bound. Affected executions can terminate with a segmentation fault (SIGSEGV) from C call-stack exhaustion.

5

What can be done if the addressed code is not yet available?

Prevent untrusted input from supplying or generating arbitrarily long path arrays, and enforce a practical maximum path length before invoking setpath, getpath, or delpaths. This avoids reaching the recursive call depth that crashes the process.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203