CVE-2026-12074: NLTK path traversal in FramenetCorpusReader allows arbitrary XML read

CVE-2026-12074 · Severity: high · CVSS 7.5 · Published 2026-07-31

The Natural Language Toolkit (NLTK), a popular Python library for processing human language data, contains a security flaw in its FrameNet corpus reader. This vulnerability allows an attacker to bypass built-in security sandboxes and read sensitive XML files from the underlying server that they should not have access to. This could lead to the exposure of private application data, configuration files, or credentials if the application processes user-supplied input through this component.

Technologies: nltk (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-12074 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-12074 being exploited in the wild.
How severe is CVE-2026-12074?
High severity, with a CVSS score of 7.5, published 31 July 2026.
Which products and versions are affected?
nltk (PyPI) <= 3.9.4, ECOSYSTEM:introduced=0,fixed=3.10.0.
Is there a fix for CVE-2026-12074?
Yes. nltk (PyPI): upgrade to 3.10.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-12074 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-12074?
Check whether you run nltk (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • nltk (PyPI): upgrade to 3.10.0 or later
    pip install "nltk>=3.10.0"

Technical details

A path traversal vulnerability exists in NLTK's FramenetCorpusReader.frame() method due to improper sanitization of the 'name' parameter. The method interpolates the user-supplied name directly into a file path and uses the Python builtin open() via XMLCorpusView, rather than the protected CorpusReader.open() interface. This bypasses the nltk.pathsec validation logic, including strict ENFORCE=True mode. An attacker can use '../' sequences to escape the corpus root and read arbitrary XML files reachable by the process. Sibling methods doc() and the lexical-unit loader are also affected via malicious corpus metadata. The issue is resolved in version 3.10.0.

Affected products

  • nltk nltk <= 3.9.4

Identifiers

  • CVE-2026-12074
  • GHSA-xh95-f55m-82fw
  • PYSEC-2026-3584

Timeline

  • 2026-06-11: disclosed
  • 2026-06-15: advisory: NVD publication date
  • 2026-07-31: patched: GitHub Advisory reviewed and published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.