REDHAT-BUG-2493020: Medium severity jqlang jq vulnerability

Published Jun 25, 2026
·
Updated

jq is a command-line JSON processor. Prior to 1.8.2, jq --rawfile can turn a handled oversized-string error into invalid-state reuse and a real heap out-of-bounds write in assertion-disabled builds. When jvloadfile(raw=1) reads an attacker-controlled file, it repeatedly appends file chunks to the same jv string accumulator. Once jvstringappendbuf() returns jvinvalidwithmsg("String too long"), the raw-file loop does not stop. If the file contains at least one more byte, the next loop iteration appends a new chunk to an object that is already invalid. With assertions enabled this aborts in jvpstringptr(). With assertions disabled, the invalid object is interpreted as a string object and ASan reports heap-buffer-overflow. This vulnerability is fixed in 1.8.2.

Affected Software

1 affected component
jqlang jq<1.8.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 1.8.2

Event History

Jun 25, 2026
Data Sourced
via Red Hat·06:02 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Systems that use jq to read an attacker-controlled file through the raw-file path are exposed, particularly where jq is built with assertions disabled. The vulnerable behavior occurs while jv_load_file(raw=1) accumulates file contents.

2

What does an attacker need to trigger the flaw?

An attacker needs control over a file processed with jq --rawfile. The file must be large enough to trigger the handled "String too long" condition and contain at least one additional byte so processing continues after the accumulator becomes invalid.

3

How does the build configuration affect impact?

With assertions enabled, jq aborts when the invalid object is used as a string. With assertions disabled, the invalid object can be treated as a string and lead to a heap out-of-bounds write.

4

What version fixes the issue?

The issue is fixed in jq 1.8.2. Versions prior to 1.8.2 are affected under the described raw-file processing conditions.

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