CVE-2026-129226
## Root Cause The semantic-logic type parser `read_type` (`nltk/sem/logic.py:866`) recurses on both halves of every `<a,b>` complex type (`nltk/sem/logic.py:882-884`) with no depth or length bound — only an `isinstance` assertion and a parenthesis-balance assertion. The `LogicParser.MAX_PARSE_DEPTH` guard (`nltk/sem/logic.py:107,294`) protects the expression parser but never runs on the `read_type` path, which is reached directly by the public `Type.fromstring` classmethod and by signature-string type checking. ## Impact An application that parses an untrusted type string, or type-checks an expression against an attacker-influenced signature, aborts with an unhandled `RecursionError`, terminating the affected operation or request worker (denial of service, CWE-674). The recursion is pure Python, yielding a catchable `RecursionError` rather than memory corruption or code execution. Confidentiality and integrity are unaffected. Exposure is narrower than a general-purpose parser because the input must reach a type-string or signature parameter. ## Attack Chain 1. The application calls `nltk.sem.logic.Type.fromstring(s)` (`nltk/sem/logic.py:736`) — or `Expression.typecheck(signature)` / `Expression.fromstring(expr, type_check=True, signature=...)`, which reach `read_type` for each type-string signature value (`nltk/sem/logic.py:1080`) — with a deeply nested type string such as `"<" * n + "e,e" + ">" * n`. 2. `Type.fromstring` passes the string straight to `read_type` with no length or depth check (only assertions on type and parenthesis balance). 3. `read_type` recurses on both halves of each `<a,b>` level, consuming one stack frame per nesting level; the `MAX_PARSE_DEPTH` guard on the separate `LogicParser` class does not execute here. 4. Once the depth exceeds the interpreter recursion limit, an unhandled `RecursionError` propagates out of the public API. ## Bypass Evidence Running the shipped `read_type`/`ComplexType`/`Type` source verbatim
Properties
- Summary
- NLTK: Uncontrolled recursion in semantic-logic type parser causes denial of service via nested type strings
- Severity
- medium
- Nvd fetched at
- 2026-11-22T12:30:49.958423+00:00
- Epss score
- 0.00419
- Cvss score
- 5.3
- Cvss severity
- MEDIUM
- Retrieved at
- 2026-11-22T12:32:26+00:00
- Ghsa published
- 2026-11-19T23:51:48Z
- Source url
- https://github.com/advisories/GHSA-w3pv-xfw4-ghr7
- Ghsa updated
- 2026-11-19T23:51:48Z
- Ghsa id
- GHSA-w3pv-xfw4-ghr7
- Last source
- FIRST EPSS
- Score
- 5.3
- Cvss version
- 3.1
- Cve id
- CVE-2026-129226
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- First seen by Signal
- 2026-11-19T19:29:21+00:00
- Name
- CVE-2026-129226
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph