Medium
jq: Stack overflow via unbounded recursion in jv_contains
Type: advisorySources: OSV
jq is a command-line JSON processor. In 1.8.1 and earlier, jv_contains recurses into nested arrays/objects with no depth limit. With a sufficiently nested input structure (built programmatically with reduce, since the JSON parser caps at depth 10000), the C stack is exhausted.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-40612
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 19:24 UTC · Revision 1
Source evidence
jq: Stack overflow via unbounded recursion in jv_contains
core-osv · Original sourcePublished 11 May 2026, 17:16 UTC
jq is a command-line JSON processor. In 1.8.1 and earlier, jv_contains recurses into nested arrays/objects with no depth limit. With a sufficiently nested input structure (built programmatically with reduce, since the JSON parser caps at depth 10000), the C stack is exhausted.
osv:CVE-2026-40612
Complete source record
{
"id": "61baa7c80d3084878d30453a3477ed4e4d54bf90cfd41a8b7241f5657b047632",
"url": "https://osv.dev/vulnerability/CVE-2026-40612",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "jq: Stack overflow via unbounded recursion in jv_contains",
"summary": "jq is a command-line JSON processor. In 1.8.1 and earlier, jv_contains recurses into nested arrays/objects with no depth limit. With a sufficiently nested input structure (built programmatically with reduce, since the JSON parser caps at depth 10000), the C stack is exhausted.",
"evidence": "osv:CVE-2026-40612",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-40612",
"aliases": [
"CVE-2026-40612",
"GHSA-r7m6-x9c7-h69j"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/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-40612.json"
}
}
],
"modified": "2026-10-28T02:30:22.930111564Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40612.json",
"https://github.com/jqlang/jq/security/advisories/GHSA-r7m6-x9c7-h69j",
"https://nvd.nist.gov/vuln/detail/CVE-2026-40612"
],
"provider_metadata": {
"cwe_ids": [
"CWE-674"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40612.json"
}
},
"related_cves": [
{
"value": "CVE-2026-40612",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 489123,
"published_at": "2026-05-11T17:16:25.453+00:00"
}