CVE-2026-78680: NLTK before 3.10.3 Arbitrary Code Execution via Graphviz dot Binary

Published Aug 25, 2026
·
Updated

NLTK versions before 3.10.3 fail to use validated absolute paths when invoking the Graphviz dot binary in dependencygraph.dot2img and AlignedSent.reprsvg, allowing attackers to execute arbitrary code by placing a malicious dot binary in the search path or current working directory. Attackers can exploit bare-name binary resolution on Windows via the current working directory or on Unix-like systems via relative PATH entries to execute their binary instead of the legitimate Graphviz tool.

Other sources

Two NLTK sites executed the Graphviz dot program by bare name, so process creation resolved it via the search path — and on Windows via the current working directory — rather than a validated absolute location. An attacker who can place a file named dot where resolution looks (the CWD on Windows, or a writable/relative entry such as . on PATH) has their binary executed in place of Graphviz (arbitrary code execution).

Affected (<= 3.10.2): - nltk.parse.dependencygraph.dot2img — called findbinary("dot") but discarded the returned validated path and then ran the bare name ["dot", ...], so the validation had no effect. - nltk.translate.api.AlignedSent.reprsvg — ran the bare name with no validation at all (IPython SVG rendering).

This is the same class already fixed for the senna, weka, boxer, malt, repp and hunpos wrappers. nltk.internals.findbinary refuses a CWD-relative match for a bare tool name and returns only a trusted absolute path; the fix runs that path in both sites.

---

Attack demonstration Captured output, not illustrative. A ./dot that writes a PWNED marker, planted in the CWD with . prepended to PATH.

The vulnerable behaviour (old bare-name exec): Control (OLD behavior) — bare ['dot'] in this dir with '.' on PATH: bare ['dot'] executed planted binary = True

The patched functions refuse it: FIXED code, with ./dot planted and '.' on PATH: dependencygraph.dot2img : Exception "Cannot find the dot binary..." | planted-binary-executed=False safe AlignedSent.reprsvg : Exception "Cannot find the dot binary..." | planted-binary-executed=False safe

And findbinary itself was attacked directly (the fix trusts nothing else): Attack 1: ./dot in CWD, no dot on PATH -> LookupError (refused) safe Attack 2: ./dot/dot (dir 'dot' holding 'dot') -> LookupError (refused) safe Attack 3: '.' on PATH + ./dot -> LookupError (refused) safe Attack 4: attacker-writable ABSOLUTE dir on PATH -> returned /…/evilbin/dot (absolute) Attack 4 is out of scope: trusting an absolute directory that is already on PATH is the operating system's own trust model — an attacker who can write to a PATH directory owns the account regardless of NLTK. findbinary defends specifically against the CWD/relative injection that bare-name exec is vulnerable to (attacks 1–3), which is exactly what this fix inherits.

Environment: python 3.13.7. dot is not required to reproduce — the planted binary is the payload.

— GitHub

Affected Software

3 affected componentsFixes available
NLTK<3.10.3
pip/nltk<=3.10.2
3.10.3
IBM API Connect V12 OnPrem<=v12.1.0.0 - v12.1.1.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/nltk to a version that resolves this vulnerability.

    Fixed in 3.10.3
  2. Upgrade

    Upgrade nltk to a version that resolves this vulnerability.

    Fixed in 3.10.3
  3. Compensating control

    Ensure the process cannot resolve attacker-controlled relative/CWD entries for Graphviz: do not include the current working directory (.) in PATH (especially on Windows), and prevent untrusted users from being able to place a malicious 'dot' executable in writable working directories that may be used when rendering Graphviz output.

Event History

Aug 25, 2026
CVE Published
via MITRE·01:30 AM
Data Sourced
via MITRE·01:30 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 AM
DescriptionSeverityWeakness
Sep 1, 2026
Advisory Published
via GitHub·08:27 PM
Data Sourced
via GitHub·08:27 PM
DescriptionSeverityWeaknessAffected Software
Oct 8, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

Which environments are exposed to this issue?

NLTK installations before 3.10.3 are exposed when code invokes dependencygraph.dot2img or AlignedSent._repr_svg_ and resolves the Graphviz dot executable by bare name. On Windows, a malicious dot binary in the current working directory can be selected; on Unix-like systems, relative entries in PATH can cause the same outcome.

2

What does an attacker need to exploit it?

An attacker needs the ability to place a malicious executable named dot in a location searched before the legitimate Graphviz binary, such as the current working directory on Windows or a relative PATH location on Unix-like systems. Exploitation also requires the affected NLTK functionality to invoke dot.

3

What is the immediate mitigation if upgrading is not possible?

Avoid invoking the affected NLTK methods in untrusted or attacker-controlled working directories, and ensure PATH does not contain relative entries. Ensure the dot executable resolved by the process is the legitimate Graphviz binary rather than an attacker-controlled file.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203