CVE-2026-63312: NLTK StreamBackedCorpusView Bypasses pathsec.ENFORCE Arbitrary File Read
NLTK before 3.10.0 contains an arbitrary local file read vulnerability in StreamBackedCorpusView that bypasses pathsec.ENFORCE by calling builtins.open() directly instead of pathsec.open(). Attackers who control the fileid argument can read arbitrary local files regardless of the ENFORCE setting, including sensitive system files and application credentials.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed?
Deployments using NLTK versions before 3.10.0 are exposed if an attacker can control the fileid argument passed to StreamBackedCorpusView. The issue is remotely exploitable without authentication or user interaction when that control is available through an exposed application path.
Does enabling pathsec.ENFORCE prevent exploitation?
No. The vulnerable code calls builtins.open() directly rather than pathsec.open(), so the pathsec.ENFORCE setting is bypassed.
What can an attacker obtain through this issue?
An attacker can read arbitrary local files accessible to the running application, including sensitive system files and application credentials. The provided data describes confidentiality impact only; it does not indicate integrity or availability impact.
What should be done if updating is not immediately possible?
Do not allow untrusted input to control the fileid argument used by StreamBackedCorpusView. Restrict file identifiers to an application-defined allowlist rather than accepting paths or path-like values from users.