Junglewise Threat Intelligence

NLTK FrameNet and NKJP readers path traversal

Severity: medium · CVSS 5.9 · Published 2026-08-22

Executive brief

NLTK is a popular natural language toolkit used for processing and analyzing text data. Versions 3.9.4 and earlier contain a path traversal vulnerability in the XML corpus readers that allows attackers to read arbitrary XML files outside the intended corpus directory by supplying malicious selectors or poisoned index data. This could expose sensitive files accessible to the application.

Technical details

The vulnerability is a path traversal (CWE-73) flaw in NLTK's FramenetCorpusReader and NKJPCorpusReader classes. The affected methods (frame_by_name, doc, lu, and header) construct file paths from caller-supplied selectors or index state without adequate path normalization or boundary checks, allowing parent-directory traversal sequences to escape the intended corpus root. An attacker who can control the input selectors or index data passed to these public APIs can read arbitrary XML files readable by the application process. No privileges or user interaction are required; exploitation requires network access only if the application exposes these readers via a network service. The vulnerability is patched in NLTK 3.10.0 and later, which adds explicit path-safety validations.

Affected products

  • NLTK Project NLTK <= 3.9.4

Timeline

  • 2026-08-07: disclosed: GHSA-568f-pv23-39p4 published
  • 2026-08-22: advisory: GHSA-qp76-pq9f-gr9m published as duplicate
  • 2026-12-xx: patched: Fixed in NLTK 3.10.0

References

Related threats