{"id":"CVE-2026-66393","aliases":["CVE-2026-66393","GHSA-rf74-v2fm-23pw","PYSEC-2026-3724"],"related":[],"kind":"vulnerability","state":"published","title":"NLTK before 3.9.4 Denial of Service via JSONTaggedDecoder","summary":"NLTK versions before 3.9.4 contain an unbounded recursion vulnerability in JSONTaggedDecoder.decode_obj() that allows attackers to cause denial of service by supplying deeply nested JSON structures. Attackers can craft JSON payloads exceeding the recursion limit to trigger an unhandled RecursionError that crashes the Python process.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"NLTK versions before 3.9.4 contain an unbounded recursion vulnerability in JSONTaggedDecoder.decode_obj() that allows attackers to cause denial of service by supplying deeply nested JSON structures. Attackers can craft JSON payloads exceeding the recursion limit to trigger an unhandled RecursionError that crashes the Python process.","source":"cvelist"},{"lang":"en","text":"### Summary\n`JSONTaggedDecoder.decode_obj()` in `nltk/jsontags.py` calls itself \nrecursively without any depth limit. A deeply nested JSON structure \nexceeding `sys.getrecursionlimit()` (default: 1000) will raise an \nunhandled `RecursionError`, crashing the Python process.\n\n### Affected code\nFile: `nltk/jsontags.py`, lines 47–52\n```python\n@classmethod\ndef decode_obj(cls, obj):\n    if isinstance(obj, dict):\n        obj = {key: cls.decode_obj(val) for (key, val) in obj.items()}\n    elif isinstance(obj, list):\n        obj = list(cls.decode_obj(val) for val in obj)\n```\n\n### Proof of Concept\n```python\nimport sys, json\nfrom nltk.jsontags import JSONTaggedDecoder\n\ndepth = sys.getrecursionlimit() + 50  # e.g. 1050\npayload = '{\"x\":' * depth + \"null\" + \"}\" * depth\n\n# Raises RecursionError, crashing the process\njson.loads(payload, cls=JSONTaggedDecoder)\n```\n\n### Impact\nAny code path that passes externally-supplied JSON to \n`JSONTaggedDecoder` is vulnerable to denial of service.\nThe severity depends on whether such a path exists in the \ncalling code (e.g. `nltk/data.py`).\n\n### Suggested Fix\nAdd a depth parameter with a hard limit:\n```python\n@classmethod\ndef decode_obj(cls, obj, _depth=0):\n    if _depth > 100:\n        raise ValueError(\"JSON nesting too deep\")\n    if isinstance(obj, dict):\n        obj = {key: cls.decode_obj(val, _depth + 1) \n               for (key, val) in obj.items()}\n    elif isinstance(obj, list):\n        obj = list(cls.decode_obj(val, _depth + 1) for val in obj)\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Versiones de NLTK anteriores a la 3.9.4 contienen una vulnerabilidad de recursión ilimitada en JSONTaggedDecoder.decode_obj() que permite a los atacantes causar denegación de servicio al proporcionar estructuras JSON profundamente anidadas. Los atacantes pueden crear cargas útiles JSON que exceden el límite de recursión para desencadenar un RecursionError no manejado que bloquea el proceso de Python.","source":"nvd"}],"published":"2026-03-18T20:17:43.000Z","modified":"2026-10-14T13:10:00.187Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}],"cwes":["CWE-674"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.9.4","status":"affected"},{"type":"semver","version":"3.9.4","status":"unaffected"}],"vendor":"nltk","product":"nltk","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.9.4"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.9.4"}],"vendor":"nltk","product":"nltk","cpe":"cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.9.4"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"pysec"}],"references":[{"url":"https://github.com/nltk/nltk/security/advisories/GHSA-rf74-v2fm-23pw","tags":["evidence","exploit","mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/nltk-before-denial-of-service-via-jsontaggeddecoder","tags":["advisory","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-66393","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/commit/00cdcd392142e6c745e7120c8d50a24127df5fad","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3724.yaml","tags":["web"],"sources":["ghsa"]}],"credits":["ZeroXJacks"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-08-26T17:54:42.004Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-66393","url":"https://www.cve.org/CVERecord?id=CVE-2026-66393","licence":"CVE Terms of Use","modified":"2026-08-26T17:55:08.015Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rf74-v2fm-23pw","url":"https://github.com/advisories/GHSA-rf74-v2fm-23pw","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:40.818Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-66393","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-66393","licence":"Public domain","modified":"2026-10-14T13:10:00.187Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3724","url":"https://osv.dev/vulnerability/PYSEC-2026-3724","licence":"CC-BY-4.0","modified":"2026-08-28T02:30:02.708Z"}],"updatedAt":"2026-11-25T22:59:34.877Z","epss":{"score":0.00363,"percentile":0.32182,"date":"2026-12-01T12:00:22.000Z"}}