NLTK dot2img Graphviz PATH Hijack Local Code Execution (CVE-2026-128134)
Detects local code execution attempts exploiting CVE-2026-128134, where NLTK's dot2img() helper invokes the Graphviz 'dot' binary without routing through NLTK's trusted-execution chokepoint (find_binary / trusted path validation). Because the subprocess resolves 'dot' via the inherited PATH, an attacker who can write to a directory on the victim's PATH (for example a user-writable directory such as ~/.local/bin) can plant a malicious executable named 'dot' that runs with the privileges of the Python process importing NLTK. The current-working-directory bare-name vector is blocked by the prior fix and is not this issue. CWE-426 (Untrusted Search Path) / CWE-427 (Uncontrolled Search Element). Affects nltk <= 3.10.3; fixed in 3.10.4. Detection focuses on Python/NLTK processes spawning a 'dot' binary from non-standard or writable filesystem locations, and on the creation of rogue 'dot' executables in writable PATH directories.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- pip
- Product
- nltk
- Versions
- <= 3.10.3
Timeline
- Disclosed
- November 16, 2026
References & Proof of Concept
- https://github.com/nltk/nltk/security/advisories/GHSA-7mxv-7h3q-9324
- https://nvd.nist.gov/vuln/detail/CVE-2026-128134
- https://github.com/nltk/nltk/pull/3887
- https://github.com/nltk/nltk/commit/b002a7288c22db86fd6ca2d9526e3f91d6fda797
- https://github.com/nltk/nltk/releases/tag/v3.10.4
- https://github.com/advisories/GHSA-7mxv-7h3q-9324
CVSS
- Attack Vector
- Local
- Attack Complexity
- Low
- Privileges Required
- Low
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
What is CVE-2026-128134 NLTK dot2img Graphviz PATH Hijack Local Code Execution (CVE-2026-128134)?
NLTK dot2img Graphviz PATH Hijack Local Code Execution (CVE-2026-128134) (CVE-2026-128134) maps to the Execution and Privilege Escalation tactics — the adversary is trying to run malicious code or instructions on a system in MITRE ATT&CK.
This page provides production-ready detection logic for NLTK dot2img Graphviz PATH Hijack Local Code Execution (CVE-2026-128134), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Execution Privilege Escalation
// df00tech DF00-a026e88391 · https://df00tech.com/detections/CVE-2026-128134 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents
| where FileName in~ ("dot", "dot.exe")
| extend ParentIsPython = InitiatingProcessFileName matches regex @"(?i)^python[0-9.]*(\.exe)?$"
| where ParentIsPython
or InitiatingProcessCommandLine has_any ("nltk", "dot2img", "dot2png")
| extend FolderLower = tolower(FolderPath)
| where not(FolderLower has_any ("/usr/bin/", "/usr/local/bin/", "/bin/", "c:\\program files\\graphviz\\"))
or FolderLower has_any ("/tmp/", "/home/", "/.local/bin/", "/dev/shm/", "\\users\\", "\\appdata\\", "\\temp\\")
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessFolderPath
| order by Timestamp desc Flags a 'dot' process spawned by a Python interpreter (or an NLTK command line) where the resolved binary lives outside standard Graphviz install locations or within a user-writable directory, the signature of a PATH-hijacked dot2img() call.
Data Sources
Required Tables
False Positives
- Legitimate Graphviz installed into a non-default/user-local prefix (e.g. a conda env or ~/.local) where NLTK genuinely renders graphs
- Developers running NLTK tree/parse visualisation in notebooks or test suites that call dot2img legitimately
- Custom analytics containers that place the real 'dot' binary under /tmp or a bind-mounted work directory
Query fingerprint DF00-a026e88391 · licence
Sigma logsource & community rules
The detection logic for NLTK dot2img Graphviz PATH Hijack Local Code Execution (CVE-2026-128134) (CVE-2026-128134) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-128134
References (6)
- https://github.com/nltk/nltk/security/advisories/GHSA-7mxv-7h3q-9324
- https://nvd.nist.gov/vuln/detail/CVE-2026-128134
- https://github.com/nltk/nltk/pull/3887
- https://github.com/nltk/nltk/commit/b002a7288c22db86fd6ca2d9526e3f91d6fda797
- https://github.com/nltk/nltk/releases/tag/v3.10.4
- https://github.com/advisories/GHSA-7mxv-7h3q-9324
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Plant rogue 'dot' in a writable PATH directory
Expected signal: File-creation event for an executable named 'dot' under ~/.local/bin and a subsequent PATH modification.
- Test 2 Trigger dot2img PATH hijack via vulnerable NLTK
Expected signal: Process-creation event: python3 spawning a 'dot' process whose image path is ~/.local/bin/dot.
- Test 3 Windows writable-PATH dot hijack
Expected signal: Process-creation event: python.exe spawning a 'dot'/'dot.bat' from %APPDATA%\bin.
Response Playbook
Triage
- Confirm the resolved path of the executed 'dot' binary; if it is under a user-writable directory (~/.local/bin, /tmp, /dev/shm, %APPDATA%) rather than a system Graphviz install, treat as probable exploitation.
- Identify the NLTK/Python version on the host: nltk <= 3.10.3 is vulnerable. Run `python3 -c "import nltk; print(nltk.__version__)"` on the affected host.
- Inspect the effective PATH of the user/process that launched Python (env, /proc/<pid>/environ) and determine whether a writable directory precedes the system bin directories.
- Review the planted 'dot' file's hash, owner, and creation time; compare against the legitimate Graphviz binary and submit the hash to reputation services.
Containment
- Quarantine or delete the rogue 'dot' executable from the writable PATH directory and preserve a forensic copy first.
- Isolate the host from the network if the rogue binary executed with elevated privileges or spawned secondary payloads.
- Remove the attacker-writable directory from the affected users' PATH or correct its precedence ahead of system directories.
Evidence Collection
- Capture the full process tree (python -> dot -> children), including command lines, parent command line and working directory.
- Collect the rogue 'dot' binary, its filesystem metadata (owner/mtime/ctime), and any files it created or modified.
- Preserve the user's shell profile / environment configuration that set the hijackable PATH entry.
Escalation Criteria
- ! Escalate to IR if the rogue 'dot' binary executed and spawned child processes, established network connections, or achieved privilege escalation.
- ! Escalate if the same rogue-binary pattern appears across multiple hosts or users, indicating a broader PATH-poisoning campaign.
- ! Escalate if the host runs server-side NLTK workloads (e.g. a web service), where exploitation could mean remote-triggered local code execution.
Investigation Guide
Forensic Artifacts
- >
The rogue 'dot' executable in a writable PATH directory, with anomalous owner and recent creation timestamp. - >
Shell history or scheduled-task entries placing the malicious binary and/or modifying PATH. - >
Process-creation telemetry (Sysmon EID 1 / auditd execve) showing python -> dot with a non-standard image path.
Tuning Guidance
Enumerate the legitimate Graphviz install paths used in your environment (system packages, conda/virtualenv prefixes, homebrew) and add them to an allowlist to suppress benign dot2img usage. If NLTK visualisation is never used in production, alert on ANY python->dot process regardless of path. Prioritise alerts where the 'dot' image path is user-writable and its owner differs from root/Administrators, which most strongly indicates PATH poisoning rather than a non-standard install.
Hunting Queries
Baselines where 'dot' binaries resolve from when launched under Python across the estate, making anomalous writable-path invocations stand out.
// df00tech DF00-a026e88391 · https://df00tech.com/detections/CVE-2026-128134 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where FileName in~ ("dot","dot.exe") | summarize count(), make_set(FolderPath) by DeviceName, InitiatingProcessFileName | where InitiatingProcessFileName matches regex @"(?i)python" ``` df00tech DF00-a026e88391 · https://df00tech.com/detections/CVE-2026-128134 · licence: https://df00tech.com/detections/licence ```
index=* (EventCode=1 OR sourcetype=linux:auditd) (Image="*dot" OR process="*dot") | stats values(Image) values(process) count by host ParentImage parent_process | search (ParentImage="*python*" OR parent_process="*python*") Atomic Red Team Tests
Simulates the attacker-controlled binary that NLTK's dot2img would resolve via PATH before the real Graphviz 'dot'.
Command
mkdir -p "$HOME/.local/bin" && printf '#!/bin/sh\nid > /tmp/nltk_dot_hijack.txt\n' > "$HOME/.local/bin/dot" && chmod +x "$HOME/.local/bin/dot" && export PATH="$HOME/.local/bin:$PATH" Cleanup
rm -f "$HOME/.local/bin/dot" /tmp/nltk_dot_hijack.txt Expected Telemetry
File-creation event for an executable named 'dot' under ~/.local/bin and a subsequent PATH modification.
Expected Detection
File-integrity / process rules flag creation of a 'dot' executable in a user-writable PATH directory.
Imports NLTK (<= 3.10.3) and calls dot2img so the planted 'dot' executes in place of Graphviz.
Command
export PATH="$HOME/.local/bin:$PATH"; python3 -c "from nltk.parse.dependencygraph import DependencyGraph; from nltk.draw.dot2img import dot2img" 2>/dev/null; python3 -c "import subprocess; subprocess.run(['dot','-V'])" Cleanup
rm -f /tmp/nltk_dot_hijack.txt Expected Telemetry
Process-creation event: python3 spawning a 'dot' process whose image path is ~/.local/bin/dot.
Expected Detection
Detection fires on a python-parented 'dot' process resolved from a writable/non-standard path.
Places a rogue dot.exe surrogate in a user-writable directory on PATH and invokes it from Python to emulate dot2img resolution on Windows.
Command
$d="$env:APPDATA\\bin"; New-Item -ItemType Directory -Force $d | Out-Null; Set-Content "$d\\dot.bat" "@echo off`r`nwhoami > %TEMP%\\nltk_dot_hijack.txt"; $env:PATH="$d;$env:PATH"; python -c "import subprocess; subprocess.run(['dot'])" Cleanup
Remove-Item "$env:APPDATA\\bin\\dot.bat","$env:TEMP\\nltk_dot_hijack.txt" -ErrorAction SilentlyContinue Expected Telemetry
Process-creation event: python.exe spawning a 'dot'/'dot.bat' from %APPDATA%\bin.
Expected Detection
Detection fires on a python-parented dot process launched from a user-writable path outside the Graphviz install directory.
Related Detections
Tactic Hubs
Related Techniques
Same Tactic: Execution
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040