Skip to content
CVE-2026-128134 Splunk · SPL

Detect NLTK dot2img Graphviz PATH Hijack Local Code Execution (CVE-2026-128134) in Splunk

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.

MITRE ATT&CK

Tactic
Execution Privilege Escalation

SPL Detection Query

Splunk (SPL)
spl
``` df00tech DF00-a026e88391 · https://df00tech.com/detections/CVE-2026-128134 · licence: https://df00tech.com/detections/licence ```
index=* (sourcetype="Sysmon:WinEventLog" EventCode=1) OR sourcetype="linux:auditd" OR sourcetype="linux:sysmon"
| eval proc=lower(coalesce(Image, exe, process))
| eval pproc=lower(coalesce(ParentImage, ppid_exe, parent_process))
| where match(proc, "(^|[\\/\\\\])dot(\.exe)?$")
| where match(pproc, "python[0-9.]*(\.exe)?$") OR like(lower(coalesce(ParentCommandLine, parent_process_command_line)), "%nltk%") OR like(lower(coalesce(ParentCommandLine, parent_process_command_line)), "%dot2img%")
| where NOT match(proc, "^(/usr/bin/|/usr/local/bin/|/bin/|c:\\\\program files\\\\graphviz\\\\)") OR match(proc, "(/tmp/|/home/|/\.local/bin/|/dev/shm/|\\\\users\\\\|\\\\appdata\\\\|\\\\temp\\\\)")
| table _time, host, user, proc, pproc, CommandLine, ParentCommandLine
| sort - _time
high severity medium confidence

Identifies a 'dot' binary launched by a Python/NLTK parent from a non-standard or writable path, indicating exploitation of the dot2img PATH search-path flaw.

Data Sources

SysmonLinux auditd

Required Sourcetypes

Sysmon:WinEventLoglinux:auditdlinux:sysmon

False Positives & Tuning

  • Graphviz installed in a virtualenv/conda prefix outside the OS default paths used for legitimate NLTK rendering
  • CI/test pipelines exercising NLTK visualisation from temporary build directories
  • Data-science notebooks legitimately invoking dot2img for parse-tree images

Other platforms for CVE-2026-128134


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.

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

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

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

  1. 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.
  2. 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.
  3. 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.
  4. 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

  1. Quarantine or delete the rogue 'dot' executable from the writable PATH directory and preserve a forensic copy first.
  2. Isolate the host from the network if the rogue binary executed with elevated privileges or spawned secondary payloads.
  3. Remove the attacker-writable directory from the affected users' PATH or correct its precedence ahead of system directories.

Evidence Collection

  1. Capture the full process tree (python -> dot -> children), including command lines, parent command line and working directory.
  2. Collect the rogue 'dot' binary, its filesystem metadata (owner/mtime/ctime), and any files it created or modified.
  3. 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.

Hunting — KQL
kql
// 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"
Hunting — SPL
spl
``` 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

Test 1 Plant rogue 'dot' in a writable PATH directory
linux

Simulates the attacker-controlled binary that NLTK's dot2img would resolve via PATH before the real Graphviz 'dot'.

Command

bash
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

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

Test 2 Trigger dot2img PATH hijack via vulnerable NLTK
linux

Imports NLTK (<= 3.10.3) and calls dot2img so the planted 'dot' executes in place of Graphviz.

Command

bash
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

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

Test 3 Windows writable-PATH dot hijack
windows

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

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

powershell
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