{"id":"CVE-2026-78680","aliases":["CVE-2026-78680","GHSA-6hwm-xvph-95vm","PYSEC-2026-3868"],"related":[],"kind":"vulnerability","state":"published","title":"NLTK before 3.10.3 Arbitrary Code Execution via Graphviz dot Binary","summary":"NLTK versions before 3.10.3 fail to use validated absolute paths when invoking the Graphviz dot binary in dependencygraph.dot2img and AlignedSent._repr_svg_, 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"NLTK versions before 3.10.3 fail to use validated absolute paths when invoking the Graphviz dot binary in dependencygraph.dot2img and AlignedSent._repr_svg_, 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.","source":"cvelist"},{"lang":"en","text":"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).\n\nAffected (<= 3.10.2):\n- `nltk.parse.dependencygraph.dot2img` — called `find_binary(\"dot\")` but discarded the returned validated path and then ran the bare name `[\"dot\", ...]`, so the validation had no effect.\n- `nltk.translate.api.AlignedSent._repr_svg_` — ran the bare name with no validation at all (IPython SVG rendering).\n\nThis is the same class already fixed for the senna, weka, boxer, malt, repp and hunpos wrappers. `nltk.internals.find_binary` 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.\n\n---\n\n## Attack demonstration\nCaptured output, not illustrative. A `./dot` that writes a `PWNED` marker, planted in the CWD with `.` prepended to `PATH`.\n\n**The vulnerable behaviour (old bare-name exec):**\n```\nControl (OLD behavior) — bare ['dot'] in this dir with '.' on PATH:\n  bare ['dot'] executed planted binary = True\n```\n\n**The patched functions refuse it:**\n```\nFIXED code, with ./dot planted and '.' on PATH:\n  dependencygraph.dot2img : Exception \"Cannot find the dot binary...\"  | planted-binary-executed=False  safe\n  AlignedSent._repr_svg_  : Exception \"Cannot find the dot binary...\"  | planted-binary-executed=False  safe\n```\n\n**And `find_binary` itself was attacked directly** (the fix trusts nothing else):\n```\nAttack 1: ./dot in CWD, no dot on PATH            -> LookupError (refused)  safe\nAttack 2: ./dot/dot (dir 'dot' holding 'dot')     -> LookupError (refused)  safe\nAttack 3: '.' on PATH + ./dot                     -> LookupError (refused)  safe\nAttack 4: attacker-writable ABSOLUTE dir on PATH  -> returned /…/evilbin/dot (absolute)\n```\nAttack 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. `find_binary` defends specifically against the CWD/relative injection that bare-name exec is vulnerable to (attacks 1–3), which is exactly what this fix inherits.\n\nEnvironment: python 3.13.7. `dot` is not required to reproduce — the planted binary is the payload.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de NLTK anteriores a la 3.10.3 no utilizan rutas absolutas validadas al invocar el binario dot de Graphviz en dependencygraph.dot2img y AlignedSent._repr_svg_, permitiendo a los atacantes ejecutar código arbitrario al colocar un binario dot malicioso en la ruta de búsqueda o en el directorio de trabajo actual. Los atacantes pueden exploit la resolución de binarios por nombre simple en Windows a través del directorio de trabajo actual o en sistemas tipo Unix a través de entradas PATH relativas para ejecutar su binario en lugar de la herramienta legítima de Graphviz.","source":"nvd"}],"published":"2026-08-25T01:30:37.044Z","modified":"2026-10-12T21:10:00.227Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.5,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.5,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-426","CWE-427"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"3.10.3","status":"affected"},{"type":"semver","version":"3.10.3","status":"unaffected"}],"vendor":"nltk","product":"nltk","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.10.3"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.10.3"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"pysec"}],"references":[{"url":"https://github.com/nltk/nltk/security/advisories/GHSA-6hwm-xvph-95vm","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/nltk-before-arbitrary-code-execution-via-graphviz-dot-binary","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-78680","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/nltk/nltk/commit/1a3cd1764ab3deb084fb66d0ffb4873717659538","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/nltk/nltk","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/nltk/nltk/releases/tag/v3.10.3","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/nltk","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-6hwm-xvph-95vm","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-08-25T12:29:42.041Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-78680","url":"https://www.cve.org/CVERecord?id=CVE-2026-78680","licence":"CVE Terms of Use","modified":"2026-08-25T12:43:04.211Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6hwm-xvph-95vm","url":"https://github.com/advisories/GHSA-6hwm-xvph-95vm","licence":"CC-BY-4.0","modified":"2026-09-10T12:25:25.368Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-78680","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-78680","licence":"Public domain","modified":"2026-10-12T21:10:00.227Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3868","url":"https://osv.dev/vulnerability/PYSEC-2026-3868","licence":"CC-BY-4.0","modified":"2026-09-10T12:15:07.211Z"}],"updatedAt":"2026-11-25T22:59:35.102Z","epss":{"score":0.00155,"percentile":0.0486,"date":"2026-12-01T12:00:22.000Z"}}