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

Source: https://junglewise.ai/threats/cve-2026-12074-nltk-path-traversal-in-framenetcorpusreader-allows-arbitrary-xml  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-31. Updated: 2026-07-31  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/nltk). Vendors: [PyPI](https://junglewise.ai/threats/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

  ```sh
  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

- [https://api.github.com/users/LinZiyuu](https://api.github.com/users/LinZiyuu)
- [https://github.com/LinZiyuu](https://github.com/LinZiyuu)
- [https://api.github.com/users/LinZiyuu/gists%7B/gist_id%7D](https://api.github.com/users/LinZiyuu/gists%7B/gist_id%7D)
- [https://api.github.com/users/LinZiyuu/repos](https://api.github.com/users/LinZiyuu/repos)
- [https://avatars.githubusercontent.com/u/104151270?v=4](https://avatars.githubusercontent.com/u/104151270?v=4)
- [https://api.github.com/users/LinZiyuu/events%7B/privacy%7D](https://api.github.com/users/LinZiyuu/events%7B/privacy%7D)

## Related threats

- [NLTK WekaClassifier path traversal in model validation](https://junglewise.ai/threats/cve-2026-109956-nltk-through-3-10-3-contains-a-path-traversal-vulnerability-in)
- [NLTK RecursiveDescentParser uncontrolled recursion denial of service](https://junglewise.ai/threats/cve-2026-12876-nltk-recursivedescentparser-uncontrolled-recursion-denial-of)
- [NLTK tgrep regular expression denial of service](https://junglewise.ai/threats/nltk-tgrep-regular-expression-denial-of-service-02fca1b2)
- [NLTK Downloader hardlink filesystem containment bypass](https://junglewise.ai/threats/nltk-downloader-hardlink-filesystem-containment-bypass-522cb97d)
- [NLTK Pl196xCorpusReader quadratic ReDoS on malformed TEI blocks](https://junglewise.ai/threats/nltk-pl196xcorpusreader-quadratic-redos-on-malformed-tei-blocks-8473e6ef)
