High (8.6)

CVE-2026-0847: Path Traversal — Patch Guide [PoC]

CVE-2026-0847

A vulnerability in NLTK versions up to and including 3.9.2 allows arbitrary file read via path traversal in multiple CorpusReader classes, including WordListCorpusReader, TaggedCorpusReader, and Brack...

Overview

A significant security vulnerability has been identified in the Natural Language Toolkit (NLTK), a widely used Python library for Natural Language Processing. The flaw allows an attacker to read arbitrary files on a server hosting an application that uses a vulnerable version of NLTK.

Vulnerability Details

In NLTK versions 3.9.2 and earlier, several core data-reading classes-specifically WordListCorpusReader, TaggedCorpusReader, and BracketParseCorpusReader-do not properly validate file paths. When these classes are used to load data based on user input, an attacker can craft a malicious path containing directory traversal sequences (like ../../../). This causes the application to read files outside the intended directory.

For example, instead of loading a harmless word list, an attacker could force the application to read sensitive system files like /etc/passwd or configuration files containing passwords and API keys.

Potential Impact

This vulnerability is rated HIGH with a CVSS score of 8.6. The primary risk is unauthorized access to sensitive information. Successful exploitation could lead to:

  • Disclosure of SSH private keys, database credentials, or cloud API tokens.
  • Leakage of application source code or configuration files.
  • Exposure of system files, which could aid in further attacks. In environments where NLTK processes external user input-such as in public-facing machine learning APIs, chatbots, or data processing pipelines-this flaw could be exploited to compromise the underlying server. This file read access can also be a critical first step toward full remote code execution if combined with other weaknesses.

Remediation and Mitigation

The most effective action is to update the NLTK library immediately.

Primary Fix:

  • Upgrade NLTK to version 3.9.3 or later. The maintainers have released a patch that adds proper path sanitization to the affected CorpusReader classes.

Immediate Mitigations (if upgrading is delayed):

  1. Input Validation: Strictly validate and sanitize any user-supplied input that is passed to NLTK corpus reader functions. Reject any paths containing directory traversal sequences (../, absolute paths like /etc/).
  2. Sandboxing: Run the affected application with the minimum necessary filesystem permissions. Use operating system controls or containerization to restrict its access to only the directories it legitimately needs.
  3. Code Review: Audit your codebase for uses of the vulnerable classes (WordListCorpusReader, TaggedCorpusReader, BracketParseCorpusReader) and ensure they are not handling untrusted input.

IT and development teams should prioritize updating this library, especially in any application where NLTK processes data from external or unauthenticated sources.

Share:

Never miss a critical vulnerability

Get real-time security alerts delivered to your preferred platform.

Public PoC References

Unverified third-party code

These repositories are publicly listed on GitHub and have not been audited by Yazoul Security. They may contain malware, backdoors, destructive payloads, or operational security risks (telemetry, exfiltration). Treat them as hostile binaries. Inspect source before execution. Run only in isolated, disposable lab environments (offline VM, no credentials, no production data).

Authorized use only. This information is provided for defensive research, detection engineering, and patch validation. Using exploit code against systems you do not own or do not have explicit written permission to test is illegal in most jurisdictions and violates Yazoul's terms of use.

Repository Stars
HyperPS/CVE-2026-0847

A vulnerability in NLTK versions up to and including 3.9.2 allows arbitrary file read via path traversal in multiple CorpusReader classes, including WordListCorpusReader, TaggedCorpusReader, and Brack

★ 0

Showing 1 of 1 known references. Source: nomi-sec/PoC-in-GitHub.

Related Advisories

Never Miss a Critical Alert

CVE advisories, breach reports, and threat intel — delivered daily to your inbox.