NLTK can run attacker's code when given a relative path to Prover9 or Mace
What this means
An attacker who can write files to a directory where your application runs can place a fake Prover9 or Mace binary there. When NLTK is told to use a relative path to find these tools, it will run the attacker's code instead with the same privileges as your application.
SecurityElites Manager Brief: the decision in one minute
NLTK versions before 3.10.4 can be tricked into running malicious code if your application tells NLTK to look for Prover9 or Mace in a relative directory path and an attacker can write files there. This is a local attack that gives the attacker full control of your application and its data. You need to upgrade NLTK immediately.
| SecurityElites Fix-First Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or infrastructure team, with input from teams using NLTK in applications. |
| Likely effort | About 30 minutes: check where NLTK is used, update to 3.10.4, restart the application, and verify the fix. It takes longer if you have many services using NLTK or if you need to test thoroughly first. |
Questions to ask your team or supplier
- Does your application call config_prover9() or config_mace() with any argument for binary_location, and if so, are those paths always absolute?
- On which systems and in which environments does this code run, and who has write access to those directories?
Message you can forward to the owning team
Security notice: NLTK can run attacker's code when given a relative path to Prover9 or Mace (CVE-2026-129234)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to nltk 3.10.4 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-129234-nltk-can-run-attackers-code-when-given-a-relative/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01448What is at stake in your AI setup
- If the application uses Prover9 or Mace as part of a logic engine for AI agents, the attacker gains code execution that could modify the agent's behaviour or outputs.
- An attacker running code as the application user could read secrets stored in memory, such as API keys for external AI services or authentication tokens.
Who is exposed
- Teams running applications that call config_prover9() or config_mace() with a relative path
- Services that accept user input to set the prover9 or mace binary location
- Shared servers where multiple users or applications run from the same directory
- Development environments where untrusted code or files might be checked out
- Teams not affected: applications that only use the default NLTK paths or always use absolute paths
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| nltk PyPI | Every version before 3.10.4 | 3.10.4 or later |
Am I affected?
Enter the version you run. Nothing you type is stored.
SecurityElites Developer Brief: the technical picture
| Is it being attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Already on the machine, or able to get a user to open something on it |
| Account needed | An ordinary user account |
| Does a person have to do something | Yes. Someone has to click, open or approve something |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | High |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Total control of the affected software, according to CISA |
Read from the official severity rating: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Kind of coding mistake
- CWE-426
- CWE-427
If you cannot upgrade today
- Until you upgrade, change any relative binary_location arguments to absolute paths. Use os.path.abspath() on the path before passing it to config_prover9() or config_mace().
- Restrict write permissions on the directory where your application runs so only the application owner and system administrators can create or modify files.
- Run your application in a container or sandbox with limited access to the host filesystem so an attacker cannot plant files in the working directory.
Signs it may already have been used against you
- Search application logs for calls to config_prover9() or config_mace() that include a relative path like '.', './bin', or any path without a leading '/'.
- Check the current working directory and parent directories of affected services for files named 'prover9' or 'mace4' that do not belong to your official installation.
- Review process audit logs (auditd on Linux, Event Viewer on Windows) for unexpected executions of prover9 or mace4 from directories other than where you installed them.
- Look for recent file writes to shared directories (like /tmp, /var/tmp, or the application's working directory) by unprivileged users around the time the application runs inference tasks.
SecurityElites Fix Guide: step by step
- Find all code that uses Prover9 or Mace from NLTKSearch your codebase for 'config_prover9', 'config_mace', 'Prover9', and 'Mace'. Look for any calls that pass a binary_location, binary_dir, or path argument. Note which files and services use these.
- Check whether any binary_location values are relative pathsReview the calls you found. A relative path is one that does not start with '/' (on Linux/Mac) or a drive letter (on Windows), for example '.', './bin', 'tools/prover9', or a plain variable without full validation. If all paths are absolute (start with /), the risk is lower but you should still upgrade.
- List all systems and services that could be affectedMake a list of servers, containers, or development machines where this code runs. Focus on systems where multiple users, processes, or untrusted code might have write access to the same directory.
- Back up your current configuration and codeExport or save your NLTK configuration, application settings, and any custom scripts that call Prover9 or Mace so you can roll back if needed.
- Upgrade NLTK to version 3.10.4 or laterUpdate the NLTK package to 3.10.4 on all affected systems. Use your normal package manager (pip, conda, apt, etc.) and deploy the change to all running services.
- If you must use a relative path, convert it to an absolute path in your codeIf you cannot upgrade immediately, change any relative binary_location values to absolute paths. For example, change './prover9' to '/usr/bin/prover9' or use os.path.abspath() to convert relative paths before passing them to config_prover9() or config_mace().
- Test that Prover9 and Mace still work after the upgradeRun a simple proof or mace query through your application and confirm it produces the expected output. Check application logs for any errors from the inference module.
- Check whether this code ran with relative paths before the fixReview your logs and audit trails from before the upgrade to see if config_prover9 or config_mace was called with relative paths. If so, assume an attacker could have planted code there; conduct a code review and check for signs of tampering.
How to confirm it is fixed: After upgrading, run a simple inference task through your application and confirm it still works correctly, then search your code and logs to confirm no calls to config_prover9() or config_mace() use relative paths.
SecurityElites Quick Fixes: copy and paste
Upgrade nltk with pipupgrade
pip install --upgrade "nltk>=3.10.4"
pip show nltk | grep VersionPin it in requirements.txtupgrade
nltk>=3.10.4Search for Prover9 and Mace use in Python codefor this issue
grep -r "config_prover9\|config_mace\|from nltk.inference" . --include="*.py"Check installed NLTK versionfor this issue
python -c "import nltk; print(nltk.__version__)"Run the service in a locked-down containergeneral hardening
docker run --read-only --cap-drop ALL \
--security-opt no-new-privileges --user 1000:1000 \
-p 127.0.0.1:8080:8080 YOUR_IMAGETest in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.
Let your AI coding assistant do the upgrade
Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.
Instruction for your coding assistant
You are helping me fix a security vulnerability (CVE-2026-129234) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n - nltk (PyPI): must be 3.10.4 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.SecurityElites Incident Drill: could your team handle this?
Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.
Ticket for your backlog
Paste into Jira, GitHub Issues or any tracker that reads Markdown.
Ready-made ticket
## NLTK can run attacker's code when given a relative path to Prover9 or Mace (CVE-2026-129234)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01448 https://securityelites.com/ai-vulnerabilities/cve-2026-129234-nltk-can-run-attackers-code-when-given-a-relative/
### Why this matters
An attacker who can write files to a directory where your application runs can place a fake Prover9 or Mace binary there. When NLTK is told to use a relative path to find these tools, it will run the attacker's code instead with the same privileges as your application.
### What to do
1. Find all code that uses Prover9 or Mace from NLTK
2. Check whether any binary_location values are relative paths
3. List all systems and services that could be affected
4. Back up your current configuration and code
5. Upgrade NLTK to version 3.10.4 or later
6. If you must use a relative path, convert it to an absolute path in your code
7. Test that Prover9 and Mace still work after the upgrade
8. Check whether this code ran with relative paths before the fix
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-129234-nltk-can-run-attackers-code-when-given-a-relative/
### Done when
- [ ] nltk is at 3.10.4 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] After upgrading, run a simple inference task through your application and confirm it still works correctly, then search your code and logs to confirm no calls to config_prover9() or config_mace() use relative paths.
- [ ] Logs were checked for signs of earlier use
SecurityElites Fix Tracker
Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.
Related vulnerabilities
In the same software
- NLTK can overwrite files outside its data folder via hardlinks during package extraction High · CVE-2026-128135
- NLTK can run untrusted Java code even after security fix in 3.10.3 Critical · CVE-2026-128138
- NLTK XML parser can be made to freeze by reading a crafted corpus file High · CVE-2026-128139
- NLTK dependency parser crashes on long sentences High · CVE-2026-129222
- NLTK WordNet tree methods can run out of memory with deep relation chains High · CVE-2026-129223
- NLTK regex compilation denial of service via many groups High · CVE-2026-129229
The same kind of mistake in other AI tools
- Langflow OSS allows arbitrary code execution through tool listing without admin check High · CVE-2026-128876
- Langflow OSS can run arbitrary code via tool-call interface before admin check High · CVE-2026-128867
- Langflow OSS allows remote code execution through improper code handling High · CVE-2026-127065
- Langflow OSS allows authenticated users to run arbitrary code High · CVE-2026-122088
- Langflow OSS allows authenticated users to run any command on the server High · CVE-2026-120601
Change history
- 19 Nov 2026: Made public
- 1 Dec 2026: Published
Official record
## Summary `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`: ```python 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 1. Entry: app calls `config_prover9(binary_location=<relative>)` / `config_mace(...)`. Guard: CWD-rejection in `find_binary_iter`. Bypass proof: truthy `path_to_bin` sets `searching_bare_name=False` → filter never runs. 2. Resolution: `find_binary` returns `'./prover9'`. Guard: boxer's `if os.path.isabs(binary): return`. Bypass proof: prover9/mace have no such loop — relative first match stored verbatim. 3. Sink: `subprocess.Popen(['./prover9']+args)` (prover9.py:207) — separator-containing path ⇒ execvp runs it relative to CWD, bypassing `$PATH`. 4. Impact: planted `./prover9`/`./mace4` executes = 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 prover
Weakness type: CWE-426, CWE-427
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-129234For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker
The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.