NLTK can run attacker's code when given a relative path to Prover9 or Mace

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 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 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 fixPlatform or infrastructure team, with input from teams using NLTK in applications.
Likely effortAbout 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-01448

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

Map where your company uses AI

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

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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().
  7. 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.
  8. 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 Version

Pin it in requirements.txtupgrade

nltk>=3.10.4

Search 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_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 would happen if an attacker placed a file named 'prover9' in the current working directory of an application that calls config_prover9(binary_location='.')?A good answer: NLTK would execute the attacker's file instead of the real Prover9 tool, allowing the attacker to run any code as the user running the application.
Why does the fix require NLTK 3.10.4 instead of just changing how applications use the library?A good answer: Because the bug is in NLTK itself: it does not check whether a provided binary path is absolute before executing it, so even correct application code cannot prevent the attack without upgrading NLTK.
Which NLTK inference tools (Prover9, Mace, Boxer, Senna, Repp, Malt) are vulnerable to this attack?A good answer: Only Prover9 and Mace; the others already reject relative paths or only accept absolute paths.
If your application always uses absolute paths for binary_location, are you safe even before upgrading NLTK?A good answer: Yes, because the attack requires a relative path; however, you should still upgrade to fix the bug and avoid accidental misuse.

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

Sign in to track this fix

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