NLTK can run attacker-controlled programs from the current directory

HighSE Fix-First Score 43/100CVE-2026-129234SE-AIV-01448Remote code executionModel serving and inferenceMade public 20 Nov 2026

Download as PDF

What this means

An attacker who can write files to a directory where your code runs can place a fake prover9 or mace4 program. If your application uses NLTK's Prover9 or Mace inference tools with a relative path setting, the fake program runs with your application's permissions. This gives the attacker full control of your system.

SecurityElites Manager Brief: the decision in one minute

NLTK inference tools accept relative paths to external programs and run them from the current working directory without checking if they are safe. An attacker can plant a fake program in that directory and have it executed. You must upgrade NLTK to version 3.10.4 or later immediately.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPython application and infrastructure teams.
Likely effortAbout 15 minutes per application: check which ones use NLTK inference tools, upgrade NLTK to 3.10.4 or later, and restart the service. Locating all affected applications may take longer in large deployments.

Questions to ask your team or supplier

  • Does any of our Python code use nltk.inference.prover9 or nltk.inference.mace? If so, what version of NLTK are we running and what paths do we pass to config_prover9() or config_mace()?
  • What directory permissions do our applications have, and can untrusted users or processes write to the directories where our application runs?
  • Do we have automated dependency scanning or update processes in place to catch library upgrades like this, and how quickly can we deploy a new NLTK version?

Message you can forward to the owning team

Security notice: NLTK can run attacker-controlled programs from the current directory (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-attacker-controlled-programs-from-the-current-directory/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01448

What is at stake in your AI setup

  • LLM or logic inference pipelines that use Prover9 or Mace: an attacker can inject malicious logic or modify proofs.
  • Knowledge bases or ontology files processed by inference tools: an attacker can read, modify, or corrupt them.
  • API keys or secrets accessible to the application process: an attacker can steal them and use them to compromise other systems.
  • Compute resources and billing: an attacker can run expensive inference tasks or crypto-mining code to drain resources and inflate costs.

Map where your company uses AI

Who is exposed

  • Applications using nltk.inference.prover9.Prover9 or nltk.inference.mace.Mace with relative binary_location paths.
  • Services running NLTK inference tools in directories where untrusted users or processes can write files.
  • Shared hosting or multi-tenant environments where multiple users have access to the same working directory.
  • Development and test environments where temporary files are created in predictable locations.

Upgrades you need

SoftwareAffected versionsMove to
nltk
PyPI
Every version before 3.10.43.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 attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAlready on the machine, or able to get a user to open something on it
Account neededAn ordinary user account
Does a person have to do somethingYes. Someone has to click, open or approve something
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downHigh
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsTotal 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 all `config_prover9(binary_location='...')` and `config_mace(binary_location='...')` calls to use absolute paths (starting with `/`). For example, use `'/usr/bin/prover9'` instead of `'./prover9'` or `'prover9'`.
  • Run your application in a directory where untrusted users cannot write files, such as a dedicated application directory with restrictive permissions.
  • Avoid calling `config_prover9()` or `config_mace()` with any relative path; use only absolute paths or the default system-wide installation.

Signs it may already have been used against you

  • Review filesystem access logs for unexpected file creation or execution of `prover9` or `mace4` in application working directories.
  • Check process execution logs for `prover9` or `mace4` processes that do not come from the expected installation directory (e.g., not from `/usr/bin/` or a system package path).
  • Examine application logs and stderr for unusual behavior or errors from inference tools immediately after a `config_prover9()` or `config_mace()` call.
  • Look for directories where your application runs for unexpected executable files named `prover9` or `mace4`.

SecurityElites Fix Guide: step by step

  1. Find where NLTK is installedRun `python3 -c 'import nltk; print(nltk.__file__)'` on each machine or container where your application runs. Note the installation path.
  2. Find which applications use Prover9 or MaceSearch your codebase for imports of `nltk.inference.prover9` and `nltk.inference.mace`. Check configuration files for `config_prover9()` or `config_mace()` calls, especially any that pass a `binary_location` argument.
  3. Check the current NLTK versionRun `pip show nltk` or `pip3 show nltk` on the machine running your application. Find the version number in the output.
  4. Review binary_location settingsIn all code that calls `config_prover9(binary_location=...)` or `config_mace(binary_location=...)`, check whether the path starts with `/` (absolute). If it is relative (starts with `.` or a folder name), it is vulnerable.
  5. Upgrade NLTK to version 3.10.4 or laterRun `pip install --upgrade 'nltk>=3.10.4'` or `pip3 install --upgrade 'nltk>=3.10.4'` on each machine. Update your requirements.txt, setup.py, or container image to require `nltk>=3.10.4`.
  6. Restart your applicationStop and start all services that use NLTK to ensure they load the new version. For web services, restart the application server. For batch jobs, re-run them.
  7. Verify the fix is in placeRun `python3 -c 'import nltk; print(nltk.__version__)'` on the machine where your application runs. Confirm the version is 3.10.4 or higher.
  8. Check for signs of prior exploitationReview system logs and process history for unexpected program executions in directories where your application runs. Look for processes spawned by your application with names like prover9 or mace4 that do not match the real tool location.

How to confirm it is fixed: Run `python3 -c 'import nltk; print(nltk.__version__)'` and confirm the version is 3.10.4 or higher.

SecurityElites Quick Fixes: copy and paste

Upgrade nltk with pipupgrade

pip install --upgrade "nltk>=3.10.4"
pip show nltk | grep Version

Pin it in requirements.txtupgrade

nltk>=3.10.4

Check installed NLTK versionfor this issue

python3 -c 'import nltk; print(nltk.__version__)'

Search for Prover9 or Mace usage in Python codefor this issue

grep -r 'from nltk.inference' . --include='*.py' | grep -E '(prover9|mace)'

Search for config_prover9 or config_mace callsfor this issue

grep -r 'config_prover9\|config_mace' . --include='*.py'

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_IMAGE

Test 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.

What is the core security issue with NLTK's Prover9 and Mace tools?A good answer: They accept relative paths to external programs and run them from the current working directory, allowing an attacker to execute a fake program if they can write to that directory.
How would an attacker exploit this vulnerability?A good answer: They write an executable file named `prover9` or `mace4` to the directory where the application runs, then wait for the application to call `config_prover9()` or `config_mace()` with a relative path, which causes the fake program to be exec
What is the minimum fix for this vulnerability?A good answer: Upgrade NLTK to version 3.10.4 or later, which prevents relative paths from being accepted for these inference tool configurations.
What can we do right now if we cannot upgrade immediately?A good answer: Change all `config_prover9()` and `config_mace()` calls to use absolute paths instead of relative paths, and restrict write access to the application's working directory.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## NLTK can run attacker-controlled programs from the current directory (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-attacker-controlled-programs-from-the-current-directory/

### Why this matters
An attacker who can write files to a directory where your code runs can place a fake prover9 or mace4 program. If your application uses NLTK's Prover9 or Mace inference tools with a relative path setting, the fake program runs with your application's permissions. This gives the attacker full control of your system.

### What to do
1. Find where NLTK is installed
2. Find which applications use Prover9 or Mace
3. Check the current NLTK version
4. Review binary_location settings
5. Upgrade NLTK to version 3.10.4 or later
6. Restart your application
7. Verify the fix is in place
8. Check for signs of prior exploitation

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-129234-nltk-can-run-attacker-controlled-programs-from-the-current-directory/

### Done when
- [ ] nltk is at 3.10.4 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Run `python3 -c 'import nltk; print(nltk.__version__)'` and confirm the version is 3.10.4 or higher.
- [ ] 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.

Sign in to track this fix

Change history

  • 19 Nov 2026: Made public
  • 1 Dec 2026: Published
  • 3 Dec 2026: Guide updated

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-129234

For 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 4 Dec 2026. Read the vendor advisory before changing a production system.