jq Stack Overflow Vulnerability in Module Loader Allowing Denial-of-Service

Vulnerability

A denial-of-service vulnerability has been identified in jq, a command-line JSON processor, in versions through 1.8.2rc1. The issue arises in the ordinary module loader, which fails to detect cycles when two valid modules include each other. This lack of cycle detection allows for unbounded recursion, leading to stack exhaustion and crashing the jq process. The vulnerability can be exploited by creating a pair of mutually including modules and loading them with jq.

Impact

Exploitation of this vulnerability causes the jq process to crash due to stack exhaustion from unbounded recursion, disrupting any workflow that relies on jq for processing JSON.

Reproduction

The vulnerability can be reproduced by building jq with AddressSanitizer and UndefinedBehaviorSanitizer enabled. After compiling jq, create a 'witness' directory containing two files, 'a.jq' and 'b.jq', which include each other. Then, run jq with the '-L' option to load the 'witness' directory and execute a command that triggers the mutual inclusion, causing a stack overflow.

Added: May 11, 2026, 7:14 PM
Updated: May 11, 2026, 7:14 PM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
2.5
exploitability
5.6
remediation
0.0
relevance
8.0
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.