<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://vulnerability.circl.lu/rss/recent/all/10</id>
  <title>Most recent entries from all</title>
  <updated>2026-10-06T05:18:44.265430+00:00</updated>
  <author>
    <name>Vulnerability-Lookup</name>
    <email>info@circl.lu</email>
  </author>
  <link href="https://vulnerability.circl.lu" rel="alternate"/>
  <generator uri="https://lkiesow.github.io/python-feedgen" version="1.0.0">python-feedgen</generator>
  <subtitle>Contains only the most 10 recent entries.</subtitle>
  <entry>
    <id>https://vulnerability.circl.lu/vuln/cve-2026-63312</id>
    <title>CVE-2026-63312 — NLTK StreamBackedCorpusView Bypasses pathsec.ENFORCE Arbitrary File Read</title>
    <updated>2026-10-06T05:18:45.511253+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> nltk</p>
<p>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.</p></div>
    </content>
    <link href="https://vulnerability.circl.lu/vuln/cve-2026-63312"/>
  </entry>
  <entry>
    <id>https://vulnerability.circl.lu/vuln/ghsa-x5ph-mj9p-rfr8</id>
    <title>GHSA-x5ph-mj9p-rfr8 — NLTK: StreamBackedCorpusView Bypasses pathsec.ENFORCE - Arbitrary Local File Read</title>
    <updated>2026-10-06T05:18:45.511367+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> PyPI: nltk</p>
<p>## Summary
Setting `nltk.pathsec.ENFORCE = True` is documented to sandbox all file access to allowed NLTK data directories and raise `PermissionError` on unauthorized access. However, `StreamBackedCorpusView` opens files via `builtins.open()` directly, bypassing `pathsec.validate_path()` entirely. An attacker who can influence the `fileid` argument can read arbitrary local files regardless of the `ENFORCE` setting.</p>
<p>## Details
`nltk/pathsec.py:274` defines the enforcement point:
```python
def open(file, mode="r", **kwargs):
    validate_path(file, context="pathsec.open")
    return builtins.open(file, mode=mode, **kwargs)
```</p>
<p>`StreamBackedCorpusView._open()` in `nltk/corpus/reader/util.py` bypasses this entirely for string paths:</p>
<p>```python
# line 171 — no validate_path() call
self._eofpos = os.stat(self._fileid).st_size</p>
<p># line 208 — calls builtins.open directly
self._stream = open(self._fileid, "rb")
```</p>
<p>Also affected: `XMLCorpusView` and any corpus reader subclass that passes a raw string `fileid` to `StreamBackedCorpusView`.</p>
<p>## PoC
```python
# poc_server.py — StreamBackedCorpusView pathsec.ENFORCE bypass
from flask import Flask, request, jsonify
import nltk.pathsec as ps
from nltk.corpus.reader.util import StreamBackedCorpusView, read_line_block</p>
<p># Strict mode enabled — expected to sandbox all file access
ps.ENFORCE = True</p>
<p>app = Flask(__name__)</p>
<p>@app.post("/read")
def read_file():
    fname = request.json.get("file")
    # fileid is user-controlled, passed directly t…</p></div>
    </content>
    <link href="https://vulnerability.circl.lu/vuln/ghsa-x5ph-mj9p-rfr8"/>
  </entry>
  <entry>
    <id>https://vulnerability.circl.lu/vuln/pysec-2026-3730</id>
    <title>PYSEC-2026-3730</title>
    <updated>2026-10-06T05:18:45.511474+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> PyPI: nltk</p>
<p>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.</p></div>
    </content>
    <link href="https://vulnerability.circl.lu/vuln/pysec-2026-3730"/>
  </entry>
</feed>
