---
id: CVE-2026-63312
title: >-
  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()
summary: >-
  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 r…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'
cwe:
  - CWE-22
vendor: nltk
product: nltk
affected:
  - nltk < 3.10.0
patched:
  - nltk 3.10.0
published: '2026-08-22'
updated: '2026-10-14'
sourceUpdated: '2026-10-14T13:10:00.187'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-63312'
references:
  - url: 'https://github.com/nltk/nltk/security/advisories/GHSA-x5ph-mj9p-rfr8'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/nltk-streambackedcorpusview-bypasses-pathsec-enforce-arbitrary-file-read
    label: disclosure@vulncheck.com
  - url: 'https://github.com/nltk/nltk/security/advisories/GHSA-x5ph-mj9p-rfr8'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-63312'
  - url: 'https://github.com/nltk/nltk/pull/3588'
  - url: >-
      https://github.com/nltk/nltk/commit/674ea75accdf08eca3782dee0a9c4ed7e0d0025b
  - url: 'https://github.com/nltk/nltk/releases/tag/v3.10.0'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3730.yaml
  - url: 'https://github.com/advisories/GHSA-x5ph-mj9p-rfr8'
  - url: 'https://github.com/nltk/nltk'
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-63312.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-63312'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2521336'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-63312'
tags:
  - nvd
  - ghsa
  - pip
  - osv
  - csaf
  - vex
  - red-hat
epss: 0.00651
epssPercentile: 0.51006
aliases:
  - GHSA-x5ph-mj9p-rfr8
  - PYSEC-2026-3730
ecosystem: pip
ingestedAt: '2026-08-23T04:42:15.353Z'
---

## Overview

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

- `nltk < 3.10.0`

## Remediation

Upgrade past the affected range:

- `nltk 3.10.0`

## Package advisory (CVE-2026-63312)

Affected packages:

- `nltk <= 3.9.4`

Patched in:

- `nltk 3.10.0`

Source: https://github.com/advisories/GHSA-x5ph-mj9p-rfr8

## Vendor advisories

- **Red Hat VEX** · Important · affected: Lightspeed Core, Red Hat Ansible Automation Platform 2 · no fix planned: Red Hat Ansible Automation Platform 2, Lightspeed Core · updated 2026-10-15 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-63312.json)
