Medium
jq: Signed-int overflow in `stack_reallocate` (jq VM stack)
Type: advisorySources: OSV
jq is a command-line JSON processor. In 1.8.1 and earlier, the jq bytecode VM's data stack tracks its allocation size in a signed int. When the stack grows beyond ≈1 GiB (via deeply nested generator forks), the doubling arithmetic overflows. The wrapped value is passed to realloc and then used for a memmove with attacker-influenced offsets.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-41257
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 02:46 UTC · Revision 1
Source evidence
jq: Signed-int overflow in `stack_reallocate` (jq VM stack)
core-osv · Original sourcePublished 11 May 2026, 17:14 UTC
jq is a command-line JSON processor. In 1.8.1 and earlier, the jq bytecode VM's data stack tracks its allocation size in a signed int. When the stack grows beyond ≈1 GiB (via deeply nested generator forks), the doubling arithmetic overflows. The wrapped value is passed to realloc and then used for a memmove with attacker-influenced offsets.
osv:CVE-2026-41257
Complete source record
{
"id": "2384a3e20fbca4c938388539b03c9d2272fc0fe16e71b2e7b77f4869c59cdb7e",
"url": "https://osv.dev/vulnerability/CVE-2026-41257",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "jq: Signed-int overflow in `stack_reallocate` (jq VM stack)",
"summary": "jq is a command-line JSON processor. In 1.8.1 and earlier, the jq bytecode VM's data stack tracks its allocation size in a signed int. When the stack grows beyond ≈1 GiB (via deeply nested generator forks), the doubling arithmetic overflows. The wrapped value is passed to realloc and then used for a memmove with attacker-influenced offsets.",
"evidence": "osv:CVE-2026-41257",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-41257",
"aliases": [
"CVE-2026-41257",
"GHSA-4jm8-m363-4539"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/jqlang/jq",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"last_affected": "4467af7068b1bcd7f882defff6e7ea674c5357f4"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"last_affected": "1.8.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"cpe": "cpe:2.3:a:jqlang:jq:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"last_affected": "1.8.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"jq-1.8.1",
"jq-1.8.0",
"jq-1.7.1",
"jq-1.7",
"jq-1.7rc2",
"jq-1.7rc1",
"jq-1.6",
"1.6rc2",
"jq-1.6rc1",
"jq-1.5rc2",
"jq-1.5rc1",
"jq-1.4",
"jq-1.3",
"jq-1.2",
"jq-1.1",
"jq-1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-41257.json"
}
}
],
"modified": "2026-10-28T02:30:49.299789631Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41257.json",
"https://github.com/jqlang/jq/security/advisories/GHSA-4jm8-m363-4539",
"https://nvd.nist.gov/vuln/detail/CVE-2026-41257"
],
"provider_metadata": {
"cwe_ids": [
"CWE-190",
"CWE-787"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41257.json"
}
},
"related_cves": [
{
"value": "CVE-2026-41257",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 517479,
"published_at": "2026-05-11T17:14:32.579+00:00"
}