jq Heap-Buffer-Overflow Vulnerability in jv_string_vfmt Function

Vulnerability

A heap-buffer-overflow vulnerability has been identified in jq, a command-line JSON processor, in versions through 1.7.1. The issue arises in the jv_string_vfmt function, within the jq_fuzz_execute harness from oss-fuzz. The vulnerability was triggered during fuzz testing, leading to a crash caused by a heap-buffer-overflow error. The problem originates from improper memory allocation, where the allocated buffer size is insufficient, allowing for out-of-bounds memory access.

Impact

Exploitation of this vulnerability leads to a heap-buffer-overflow, a common type of vulnerability that can be exploited to execute arbitrary code or cause a program to crash.

Reproduction

The vulnerability can be reproduced by compiling jq with the build script from oss-fuzz, and then running the jq_fuzz_execute harness with a crafted input that triggers the heap-buffer-overflow. The AddressSanitizer will report the heap-buffer-overflow error, indicating that the vulnerability has been successfully exploited.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
2.5
exploitability
6.0
remediation
0.0
relevance
0.0
threat
6.4
urgency
2.9
incentive
0.8

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