CVE-2026-49839: jq --rawfile invalid-state reuse after String too long causes heap-buffer-overflow

Published Jun 25, 2026
·
Updated

jq --rawfile invalid-state reuse after String too long causes heap-buffer-overflow

Other sources

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.

MITRE

Affected Software

4 affected componentsFixes available
JQ jq<1.8.2
jqlang jq<1.8.2
Microsoft azl3 jq 1.7.1-6<1.7.1-7
1.7.1-7
Microsoft azl3 jq 1.7.1-8<1.7.1-8
1.7.1-8

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.7.1-7
  2. Upgrade

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

    Fixed in 1.7.1-8
  3. Upgrade

    Upgrade jq to a version that resolves this vulnerability.

    Fixed in 1.8.2

Event History

Jun 25, 2026
CVE Published
via MITRE·05:17 PM
Data Sourced
via MITRE·05:17 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 27, 2026
Data Sourced
via Microsoft·08:08 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:08 AM
DescriptionSeverity
Updated
via Microsoft·08:08 AM
Affected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-49839?

CVE-2026-49839 has a severity score of 7.1, which is classified as high.

2

How does CVE-2026-49839 exploit vulnerabilities in jq?

CVE-2026-49839 exploits jq by causing heap-buffer overflow through invalid-state reuse when processing oversized strings.

3

How can I mitigate CVE-2026-49839?

To mitigate CVE-2026-49839, upgrade jq to version 1.8.2 or later which resolves the vulnerability.

4

Who is affected by CVE-2026-49839?

Users of jq prior to version 1.8.2 are at risk of CVE-2026-49839 due to improper handling of oversized strings.

5

What impact does CVE-2026-49839 have on system security?

CVE-2026-49839 can lead to a heap out-of-bounds write, potentially allowing an attacker to execute arbitrary code.

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