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

High 7.1 Published Updated

Attackers can trigger a heap buffer overflow in jq via crafted files, potentially leading to code execution or crashes.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-49839?

CVE-2026-49839 is a high-severity memory corruption vulnerability in jqlang jq, published on 25 Jun 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

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 jv_load_file(raw=1) reads an attacker-controlled file, it repeatedly appends file chunks to the same jv string accumulator. Once jv_string_append_buf() returns jv_invalid_with_msg("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 jvp_string_ptr(). 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.

Weakness: CWE-787

Which versions are affected by CVE-2026-49839?

It affects 1 product.

Products include Jqlang Jq.

How do I fix CVE-2026-49839?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2026-49839 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-49839 exists.

Sources

Also known as ALPINE-CVE-2026-49839, AZL-90267, BELL-CVE-2026-49839, CLSA-2026-1783339505, CLSA-2026-1783340505, DEBIAN-CVE-2026-49839 and 3 more.

Is CVE-2026-49839 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free