CVE-2026-39956

jq: Missing runtime type checks for _strindices lead to crash and limited memory disclosure

Published Apr 13, 2026 CVSS 3.1 · 6.1 Medium EPSS < 1% KEV · Not listed
Description
jq is a command-line JSON processor. Prior to version 1.8.2, the _strindices builtin in jq's src/builtin.c passes its arguments directly to jv_string_indexes() without verifying they are strings, and jv_string_indexes() in src/jv.c relies solely on assert() checks that are stripped in release builds compiled with -DNDEBUG. This allows an attacker to crash jq trivially with input like _strindices(0), and by crafting a numeric value whose IEEE-754 bit pattern maps to a chosen pointer, achieve a controlled pointer dereference and limited memory read/probe primitive. Any deployment that evaluates untrusted jq filters against a release build is vulnerable. This issue has been patched in commit fdf8ef0f0810e3d365cdd5160de43db46f57ed03, which is part of version 1.8.2.

Analysis

AI-generated

Technical impact

The vulnerability arises from the _strindices builtin passing arguments directly to a string indexer without validating that the input is actually a string. In a release build, missing assertions allow the function to dereference a pointer derived from an arbitrary numeric value. This results in a program crash, and by crafting a numeric payload that maps to a chosen IEEE‑754 bit pattern, an attacker can read small amounts of memory around that pointer. The effect is a denial‑of‑service condition and limited memory disclosure. The weakness maps to dereference of null or invalid pointers and misuse of type casting.

Affected Systems

The affected product is jq, a command‑line JSON processor maintained by the jqlang community. All jq releases before the patch commit fdf8ef0f0810e3d365cdd5160de43db46f57ed03, or any distribution package containing a jq binary built from source before that commit, are vulnerable. Specific version ranges are not enumerated, but any distribution package containing jq built from source before the patch is susceptible.

Risk and Exploitability

The CVSS base score of 6.1 indicates a moderate severity. The EPSS score is less than 1%, indicating a very low likelihood of exploitation, and the vulnerability is not listed in the CISA KEV catalog. The attack vector is likely local: a user who can supply or influence a jq filter can trigger the crash or trigger the memory read primitive. In contexts where jq processes untrusted input in a server or privileged environment, the danger escalates to a remote denial‑of‑service. The exploitation requires only the presence of a vulnerable jq binary and crafted input, making it relatively easy to perform once the target is known.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update jq to a version containing commit fdf8ef0f0810e3d365cdd5160de43db46f57ed03 or later
  • If an immediate upgrade is not possible, restrict the execution of jq to trusted input only or run it in a sandboxed environment
  • Consider using stricter input validation around JSON filters before passing them to jq

Generated by OpenCVE AI on September 4, 2026 at 15:59 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4599-1 jq security update
Debian DLA Debian DLA DLA-4662-1 jq security update
Ubuntu USN Ubuntu USN USN-8202-2 jq vulnerabilities
Ubuntu USN Ubuntu USN USN-8202-1 jq vulnerabilities
History
Type Values Removed Values Added
Description jq is a command-line JSON processor. In commits after 69785bf77f86e2ea1b4a20ca86775916889e91c9, the _strindices builtin in jq's src/builtin.c passes its arguments directly to jv_string_indexes() without verifying they are strings, and jv_string_indexes() in src/jv.c relies solely on assert() checks that are stripped in release builds compiled with -DNDEBUG. This allows an attacker to crash jq trivially with input like _strindices(0), and by crafting a numeric value whose IEEE-754 bit pattern maps to a chosen pointer, achieve a controlled pointer dereference and limited memory read/probe primitive. Any deployment that evaluates untrusted jq filters against a release build is vulnerable. This issue has been patched in commit fdf8ef0f0810e3d365cdd5160de43db46f57ed03. jq is a command-line JSON processor. Prior to version 1.8.2, the _strindices builtin in jq's src/builtin.c passes its arguments directly to jv_string_indexes() without verifying they are strings, and jv_string_indexes() in src/jv.c relies solely on assert() checks that are stripped in release builds compiled with -DNDEBUG. This allows an attacker to crash jq trivially with input like _strindices(0), and by crafting a numeric value whose IEEE-754 bit pattern maps to a chosen pointer, achieve a controlled pointer dereference and limited memory read/probe primitive. Any deployment that evaluates untrusted jq filters against a release build is vulnerable. This issue has been patched in commit fdf8ef0f0810e3d365cdd5160de43db46f57ed03, which is part of version 1.8.2.
Type Values Removed Values Added
CPEs cpe:2.3:a:jqlang:jq:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Jqlang
Jqlang jq
Vendors & Products Jqlang
Jqlang jq
Type Values Removed Values Added
Description jq is a command-line JSON processor. In commits after 69785bf77f86e2ea1b4a20ca86775916889e91c9, the _strindices builtin in jq's src/builtin.c passes its arguments directly to jv_string_indexes() without verifying they are strings, and jv_string_indexes() in src/jv.c relies solely on assert() checks that are stripped in release builds compiled with -DNDEBUG. This allows an attacker to crash jq trivially with input like _strindices(0), and by crafting a numeric value whose IEEE-754 bit pattern maps to a chosen pointer, achieve a controlled pointer dereference and limited memory read/probe primitive. Any deployment that evaluates untrusted jq filters against a release build is vulnerable. This issue has been patched in commit fdf8ef0f0810e3d365cdd5160de43db46f57ed03.
Title jq: Missing runtime type checks for _strindices lead to crash and limited memory disclosure
Weaknesses CWE-125
CWE-476
CWE-843
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H'}

Weaknesses
  • CWE-125

    Out-of-bounds Read

  • CWE-1287

    Improper Validation of Specified Type of Input

  • CWE-476

    NULL Pointer Dereference

  • CWE-843

    Access of Resource Using Incompatible Type ('Type Confusion')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 4, 2026, 1:29 PM
Reserved
Apr 7, 2026, 10:40 PM
Status
Modified
Published
Apr 13, 2026, 11:16 PM
Modified
Oct 26, 2026, 9:10 PM
Severity
Moderate
Public date
Apr 13, 2026, 10:10 PM