GHSA-CC5R-64RF-75HG
Vulnerability from github – Published: 2026-11-19 23:46 – Updated: 2026-11-19 23:46Summary
Prover9Parent.config_prover9(binary_location=...) (and Mace, which inherits it) accepts a relative binary_location and passes it as path_to_bin to find_binary, which disables the CWD-relative rejection guard. Unlike the boxer/senna/malt/repp siblings, prover9/mace apply no os.path.isabs() filter, so the resolved relative program path (e.g. ./prover9) is executed from the current working directory via subprocess.Popen. A local attacker who can plant ./prover9 (or ./mace4) in the resolved directory achieves local code execution.
Root Cause
nltk/inference/prover9.py:121-135 calls find_binary(name, path_to_bin=binary_location, env_vars=["PROVER9"], ...). A truthy path_to_bin sets searching_bare_name = not path_to_bin and ... → False (internals.py:935), so the guard if searching_bare_name and not os.path.isabs(path): continue (internals.py:940) never runs. The result is stored in self._prover9_bin; on the next prove(), _call → subprocess.Popen([binary]+args, ...) (prover9.py:207) execs it. Mace(Prover9Parent) inherits config_prover9 (mace.py:229). By contrast boxer's _find_binary (sem/boxer.py:251-266) iterates find_binary_iter and returns only the first os.path.isabs() result; repp/malt/senna similarly reject a relative explicit bin dir. prover9/mace have no such filter.
Impact
Local arbitrary code execution: an attacker-planted ./prover9/./mace4 runs as the invoking user when the application is configured with a relative binary_location and the attacker can write to the resolved directory.
Proof of Concept
In a directory containing an executable ./prover9:
from nltk.inference.prover9 import Prover9
p = Prover9(); p.config_prover9(binary_location='.')
# p._prover9_bin == './prover9'; subsequent prove() Popens it from CWD
Runtime-confirmed: find_binary('prover9', path_to_bin='.') → './prover9'; bare find_binary('prover9') and relative PROVER9='.' via default _find_binary both raise LookupError (the default path is protected).
Attack Chain
- Entry: app calls
config_prover9(binary_location=<relative>)/config_mace(...). Guard: CWD-rejection infind_binary_iter. Bypass proof: truthypath_to_binsetssearching_bare_name=False→ filter never runs. - Resolution:
find_binaryreturns'./prover9'. Guard: boxer'sif os.path.isabs(binary): return. Bypass proof: prover9/mace have no such loop — relative first match stored verbatim. - Sink:
subprocess.Popen(['./prover9']+args)(prover9.py:207) — separator-containing path ⇒ execvp runs it relative to CWD, bypassing$PATH. - Impact: planted
./prover9/./mace4executes = local code execution.
Bypass Evidence
Runtime: find_binary('prover9', path_to_bin='.') -> './prover9'; find_binary('prover9') -> LookupError. git log -- nltk/inference/prover9.py nltk/inference/mace.py shows only copyright/formatting commits — no security fix. GHSA-6hwm-xvph-95vm (CWE-426/427) is scoped to the dot binary and names the swept class as senna/weka/boxer/malt/repp/hunpos — prover9/mace absent.
Affected Versions
<= 3.10.3 — present on latest release and HEAD; no fix.
Suggested Fix
Mirror boxer: accept only the first os.path.isabs() result from find_binary_iter, or reject a relative binary_location in config_prover9/config_mace.
Reported by zx (Jace) — GitHub: @manus-use
Fix status (2026-09-28)
Status: IN PROGRESS (fix on an open pull request, not yet on develop).
PR: #3887 "Resolve every executed tool binary absolute-only: prover9/mace4, megam, tadm, java, hunpos (untrusted search path, CWE-426/427)", open; head 3ac1c5641 at the time of this note (a develop merge on top of 16b1de8ee, the head on which the verdicts below were measured).
Fix commits: f0a75c665 (a relative binary_location is rejected in prover9/mace, megam and tadm), 4ca190b74 (find_binary_absolute refuses a match containing '..'; config_java, hunpos and the prover9 helpers resolve absolute-only), 992884a02 (the JVM is resolved before spawning and spawned through spawn_trusted), d4f0309bb (own PATH walk without which, pathsec-gated tool locations, a pre-commit hook that keeps every spawn on pathsec).
Probe: nltk/test/unit/security_probes/ghsa_cc5r_64rf_75hg.py (on the PR). Verdict on the PR head: FIXED (213 relative locations refused across 9 entry points; with an install configured every form resolved to it and never to a CWD decoy; a PATH climbing into the decoy directory was refused; a world-writable install was refused at launch). The same probe run against develop 2fa3f48fe: VULNERABLE (config_prover9('./') took the CWD-relative binary ./prover9).
Release: none.
Maintainer reply (2026-09-28)
Status: fixed on develop, unreleased.
Fix: PR #3887 "Resolve every executed tool binary absolute-only: prover9/mace4, megam, tadm, java, hunpos (untrusted search path, CWE-426/427)", merged 2026-09-28 as merge commit 0ebe329cee693e7f84cb5d477b7a3638066194c8 on develop (PR head 3ac1c5641). Fix commits: f0a75c665 (a relative binary_location is refused in prover9/mace, megam and tadm), 4ca190b74 (find_binary_absolute refuses any match with a '..' component; config_java, hunpos and the prover9 helpers resolve absolute-only), 992884a02 (the JVM is resolved before spawning and spawned through spawn_trusted), d4f0309bb (own PATH walk without shelling out to which, pathsec-gated tool locations, and a pre-commit hook that keeps every subprocess spawn in nltk on the pathsec chokepoint). Prover9Parent.config_prover9 and Mace now resolve through nltk.internals.find_binary_absolute, which returns only an absolute candidate with no '..' component, so a relative binary_location can never select a file under the current working directory; the spawn itself goes through nltk.pathsec.spawn_trusted, which refuses a relative or untrusted executable even if one were handed to it directly.
Verification on develop 0ebe329ce with env -u PYTHONPATH /usr/local/bin/python3.13 (CPython 3.13.7, macOS). The proof of concept was run literally: an executable ./prover9 and ./mace4 planted in the working directory, each writing a marker file when run, PROVER9 unset, PATH pointing at an empty directory. Prover9().config_prover9('.') and Mace().config_prover9('.') both raise LookupError ("NLTK found 'prover9' only in the current working directory, which is not a trusted location for executables"), the later prove() and build_model() calls raise LookupError as well, and the marker file is never written. The reporter's bypass primitive find_binary('prover9', path_to_bin='.') now raises LookupError. Every relative form was tried at config time ('.', './', 'sub', './sub', './prover9', ''), through the PROVER9 variable ('.'), and through PATH entries ('.', '', 'sub', './sub'); all refused. With an absolute install configured through PROVER9, every one of those forms resolves to the install and never to the planted decoy. The regression probe nltk/test/unit/security_probes/ghsa_cc5r_64rf_75hg.py reports FIXED on develop (213 relative locations refused across 9 entry points; a PATH entry climbing into the decoy directory refused; a world-writable install refused at launch); the same probe reported VULNERABLE on develop 2fa3f48fe before the merge. nltk/test/unit/test_tool_search_path_security.py: 93 passed, 1 skipped, including the literal end-to-end proof of concept for Prover9 and Mace.
Severity reassessment. Reviewed and kept at High. CVSS 3.1 vector CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H, base score 7.3, unchanged from the report. Reasoning: the planted binary has to be on the local filesystem (AV:L); the vulnerability needs the application to be configured with a relative binary_location, and the CVSS 3.1 user guide (section 2.3.3) says a configuration-dependent vulnerability is scored assuming that configuration, so attack complexity stays Low (AC:L); the attacker needs write access to the resolved directory, a low-privileged local account (PR:L); the victim has to run the prover or model builder with that configuration (UI:R); the effect stays within the process (S:U); the planted binary runs as the invoking user (C:H, I:H, A:H). This matches how CWE-426 untrusted search path issues are scored in the NVD (7.3 with UI:R, 7.8 with UI:N) and sits at the same level as the sibling Graphviz dot advisory in this repository.
Release status. Not yet released; no tag contains 0ebe329ce. The latest release v3.10.3 (2026-08-12) predates the fix. The fix will ship in the next release.
Closing this advisory as fixed on develop.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.10.3"
},
"package": {
"ecosystem": "PyPI",
"name": "nltk"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.10.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-129234"
],
"database_specific": {
"cwe_ids": [
"CWE-426",
"CWE-427"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-19T23:46:54Z",
"nvd_published_at": "2026-11-19T17:17:56Z",
"severity": "HIGH"
},
"details": "## Summary\n`Prover9Parent.config_prover9(binary_location=...)` (and `Mace`, which inherits it) accepts a relative `binary_location` and passes it as `path_to_bin` to `find_binary`, which disables the CWD-relative rejection guard. Unlike the boxer/senna/malt/repp siblings, prover9/mace apply no `os.path.isabs()` filter, so the resolved relative program path (e.g. `./prover9`) is executed from the current working directory via `subprocess.Popen`. A local attacker who can plant `./prover9` (or `./mace4`) in the resolved directory achieves local code execution.\n\n## Root Cause\n`nltk/inference/prover9.py:121-135` calls `find_binary(name, path_to_bin=binary_location, env_vars=[\"PROVER9\"], ...)`. A truthy `path_to_bin` sets `searching_bare_name = not path_to_bin and ...` \u2192 False (`internals.py:935`), so the guard `if searching_bare_name and not os.path.isabs(path): continue` (`internals.py:940`) never runs. The result is stored in `self._prover9_bin`; on the next `prove()`, `_call` \u2192 `subprocess.Popen([binary]+args, ...)` (`prover9.py:207`) execs it. `Mace(Prover9Parent)` inherits `config_prover9` (`mace.py:229`). By contrast boxer\u0027s `_find_binary` (`sem/boxer.py:251-266`) iterates `find_binary_iter` and returns only the first `os.path.isabs()` result; repp/malt/senna similarly reject a relative explicit bin dir. prover9/mace have no such filter.\n\n## Impact\nLocal arbitrary code execution: an attacker-planted `./prover9`/`./mace4` runs as the invoking user when the application is configured with a relative `binary_location` and the attacker can write to the resolved directory.\n\n## Proof of Concept\nIn a directory containing an executable `./prover9`:\n```python\nfrom nltk.inference.prover9 import Prover9\np = Prover9(); p.config_prover9(binary_location=\u0027.\u0027)\n# p._prover9_bin == \u0027./prover9\u0027; subsequent prove() Popens it from CWD\n```\nRuntime-confirmed: `find_binary(\u0027prover9\u0027, path_to_bin=\u0027.\u0027)` \u2192 `\u0027./prover9\u0027`; bare `find_binary(\u0027prover9\u0027)` and relative `PROVER9=\u0027.\u0027` via default `_find_binary` both raise `LookupError` (the default path is protected).\n\n## Attack Chain\n1. Entry: app calls `config_prover9(binary_location=\u003crelative\u003e)` / `config_mace(...)`. Guard: CWD-rejection in `find_binary_iter`. Bypass proof: truthy `path_to_bin` sets `searching_bare_name=False` \u2192 filter never runs.\n2. Resolution: `find_binary` returns `\u0027./prover9\u0027`. Guard: boxer\u0027s `if os.path.isabs(binary): return`. Bypass proof: prover9/mace have no such loop \u2014 relative first match stored verbatim.\n3. Sink: `subprocess.Popen([\u0027./prover9\u0027]+args)` (prover9.py:207) \u2014 separator-containing path \u21d2 execvp runs it relative to CWD, bypassing `$PATH`.\n4. Impact: planted `./prover9`/`./mace4` executes = local code execution.\n\n## Bypass Evidence\nRuntime: `find_binary(\u0027prover9\u0027, path_to_bin=\u0027.\u0027) -\u003e \u0027./prover9\u0027`; `find_binary(\u0027prover9\u0027) -\u003e LookupError`. `git log -- nltk/inference/prover9.py nltk/inference/mace.py` shows only copyright/formatting commits \u2014 no security fix. GHSA-6hwm-xvph-95vm (CWE-426/427) is scoped to the `dot` binary and names the swept class as senna/weka/boxer/malt/repp/hunpos \u2014 prover9/mace absent.\n\n## Affected Versions\n`\u003c= 3.10.3` \u2014 present on latest release and HEAD; no fix.\n\n## Suggested Fix\nMirror boxer: accept only the first `os.path.isabs()` result from `find_binary_iter`, or reject a relative `binary_location` in `config_prover9`/`config_mace`.\n\n---\nReported by **zx (Jace)** \u2014 GitHub: @manus-use\n\n## Fix status (2026-09-28)\n\nStatus: IN PROGRESS (fix on an open pull request, not yet on develop).\n\nPR: #3887 \"Resolve every executed tool binary absolute-only: prover9/mace4, megam, tadm, java, hunpos (untrusted search path, CWE-426/427)\", open; head 3ac1c5641 at the time of this note (a develop merge on top of 16b1de8ee, the head on which the verdicts below were measured).\n\nFix commits: f0a75c665 (a relative binary_location is rejected in prover9/mace, megam and tadm), 4ca190b74 (find_binary_absolute refuses a match containing \u0027..\u0027; config_java, hunpos and the prover9 helpers resolve absolute-only), 992884a02 (the JVM is resolved before spawning and spawned through spawn_trusted), d4f0309bb (own PATH walk without which, pathsec-gated tool locations, a pre-commit hook that keeps every spawn on pathsec).\n\nProbe: nltk/test/unit/security_probes/ghsa_cc5r_64rf_75hg.py (on the PR). Verdict on the PR head: FIXED (213 relative locations refused across 9 entry points; with an install configured every form resolved to it and never to a CWD decoy; a PATH climbing into the decoy directory was refused; a world-writable install was refused at launch). The same probe run against develop 2fa3f48fe: VULNERABLE (config_prover9(\u0027./\u0027) took the CWD-relative binary ./prover9).\n\nRelease: none.\n\n## Maintainer reply (2026-09-28)\n\nStatus: fixed on develop, unreleased.\n\nFix: PR #3887 \"Resolve every executed tool binary absolute-only: prover9/mace4, megam, tadm, java, hunpos (untrusted search path, CWE-426/427)\", merged 2026-09-28 as merge commit 0ebe329cee693e7f84cb5d477b7a3638066194c8 on develop (PR head 3ac1c5641). Fix commits: f0a75c665 (a relative binary_location is refused in prover9/mace, megam and tadm), 4ca190b74 (find_binary_absolute refuses any match with a \u0027..\u0027 component; config_java, hunpos and the prover9 helpers resolve absolute-only), 992884a02 (the JVM is resolved before spawning and spawned through spawn_trusted), d4f0309bb (own PATH walk without shelling out to which, pathsec-gated tool locations, and a pre-commit hook that keeps every subprocess spawn in nltk on the pathsec chokepoint). Prover9Parent.config_prover9 and Mace now resolve through nltk.internals.find_binary_absolute, which returns only an absolute candidate with no \u0027..\u0027 component, so a relative binary_location can never select a file under the current working directory; the spawn itself goes through nltk.pathsec.spawn_trusted, which refuses a relative or untrusted executable even if one were handed to it directly.\n\nVerification on develop 0ebe329ce with env -u PYTHONPATH /usr/local/bin/python3.13 (CPython 3.13.7, macOS). The proof of concept was run literally: an executable ./prover9 and ./mace4 planted in the working directory, each writing a marker file when run, PROVER9 unset, PATH pointing at an empty directory. Prover9().config_prover9(\u0027.\u0027) and Mace().config_prover9(\u0027.\u0027) both raise LookupError (\"NLTK found \u0027prover9\u0027 only in the current working directory, which is not a trusted location for executables\"), the later prove() and build_model() calls raise LookupError as well, and the marker file is never written. The reporter\u0027s bypass primitive find_binary(\u0027prover9\u0027, path_to_bin=\u0027.\u0027) now raises LookupError. Every relative form was tried at config time (\u0027.\u0027, \u0027./\u0027, \u0027sub\u0027, \u0027./sub\u0027, \u0027./prover9\u0027, \u0027\u0027), through the PROVER9 variable (\u0027.\u0027), and through PATH entries (\u0027.\u0027, \u0027\u0027, \u0027sub\u0027, \u0027./sub\u0027); all refused. With an absolute install configured through PROVER9, every one of those forms resolves to the install and never to the planted decoy. The regression probe nltk/test/unit/security_probes/ghsa_cc5r_64rf_75hg.py reports FIXED on develop (213 relative locations refused across 9 entry points; a PATH entry climbing into the decoy directory refused; a world-writable install refused at launch); the same probe reported VULNERABLE on develop 2fa3f48fe before the merge. nltk/test/unit/test_tool_search_path_security.py: 93 passed, 1 skipped, including the literal end-to-end proof of concept for Prover9 and Mace.\n\nSeverity reassessment. Reviewed and kept at High. CVSS 3.1 vector CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H, base score 7.3, unchanged from the report. Reasoning: the planted binary has to be on the local filesystem (AV:L); the vulnerability needs the application to be configured with a relative binary_location, and the CVSS 3.1 user guide (section 2.3.3) says a configuration-dependent vulnerability is scored assuming that configuration, so attack complexity stays Low (AC:L); the attacker needs write access to the resolved directory, a low-privileged local account (PR:L); the victim has to run the prover or model builder with that configuration (UI:R); the effect stays within the process (S:U); the planted binary runs as the invoking user (C:H, I:H, A:H). This matches how CWE-426 untrusted search path issues are scored in the NVD (7.3 with UI:R, 7.8 with UI:N) and sits at the same level as the sibling Graphviz dot advisory in this repository.\n\nRelease status. Not yet released; no tag contains 0ebe329ce. The latest release v3.10.3 (2026-08-12) predates the fix. The fix will ship in the next release.\n\nClosing this advisory as fixed on develop.",
"id": "GHSA-cc5r-64rf-75hg",
"modified": "2026-11-19T23:46:54Z",
"published": "2026-11-19T23:46:54Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/security/advisories/GHSA-cc5r-64rf-75hg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-129234"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/pull/3887"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/4ca190b744ec72500c4c8a8259aece7792a46877"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/992884a02f6fb5180a992ed12d20103b4b5cb8a0"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/d4f0309bb8649f77e88c2c435e5fa31e6c5ab225"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/f0a75c66506977c0f683281c0f5275dbfbaee3b2"
},
{
"type": "PACKAGE",
"url": "https://github.com/nltk/nltk"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/releases/tag/v3.10.4"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "NLTK: Untrusted search path in prover9/mace4 config allows local code execution via relative binary_location"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.