SecurityContext

CVE-2025-71408: NLTK - Code Injection

  • Cve: CVE-2025-71408
  • Name: NLTK - Code Injection
  • Description: NLTK (Natural Language Toolkit) before version 3.9.3 contains an eval injection vulnerability in the nltk.collocations module that allows an attacker who controls command-line arguments to execute arbitrary Python code. When collocations.py is invoked directly, the __main__ block passes command-line arguments directly to eval() as suffixes of BigramAssocMeasures without allowlist validation or sanitization, enabling an attacker to supply a Python expression that escapes the intended attribute lookup and executes arbitrary code including OS commands via the os module.
  • Impact: Attackers can execute arbitrary Python code and OS commands, potentially leading to full system compromise.
  • Remediation: Update to version 3.9.3 or later.
  • Vulnerability type: code_injection
  • Vulnerability impact: remote_code_execution
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: high
  • Cvss score: 7.8
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.00265
  • Epss percentile: 0.18578
  • Assignee: [email protected]
  • Published at: 2026-07-24T22:16:50Z
  • Age in days: 123
  • Modified at: 2026-10-08T16:16:53Z
  • Patch available: yes
  • Public exploits total: 1
  • References total: 5
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2025-71408
  • Nvd status: analyzed
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-95Improper Neutralization of Directives in Dynamically Evaluated Code

Public exploits

UrlSourceAdded date
https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/nvd2026-07-24

References

Same in every row:

  • Source: nvd
UrlTags
https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0acPatch
https://github.com/nltk/nltk/pull/3465Issue Tracking, Patch
https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-argumentsPatch, Third Party Advisory
https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/Exploit, Press/Media Coverage, Third Party Advisory
https://github.com/nltk/nltk/releases/tag/3.9.3Release Notes

Products

ProductAffectedPlatform boundSourcesUrl
nltk:nltk< 3.9.3nonvd/v1/products/nltk/nltk

Projects

RepositoryLink kindsIndexedUrl
nltk/nltkcommit, package, pull, releasesyes/v1/repositories/nltk/nltk

Index

  • Repositories: 756
  • Repositories high signal: 371
  • Packages: 1

Exploitation

  • Public exploit: yes
  • Public exploit count: 1
  • Public exploit first date: 2026-07-24
  • Authentication required: yes
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts