<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Cve-2026-12072 - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/cve-2026-12072/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 31 Jul 2026 19:30:03 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/cve-2026-12072/feed.xml" rel="self" type="application/rss+xml"/><item><title>NLTK NKJPCorpusReader Path Traversal Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-07-nltk-path-traversal/</link><pubDate>Fri, 31 Jul 2026 19:30:03 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-nltk-path-traversal/</guid><description>A path-traversal vulnerability in NLTK's NKJPCorpusReader allows attackers to read arbitrary files by bypassing the nltk.pathsec security sandbox.</description><content:encoded><![CDATA[<p>The Natural Language Toolkit (NLTK) version 3.9.4 and earlier contains a critical path-traversal vulnerability (CVE-2026-12072) within the <code>NKJPCorpusReader</code> class. The component fails to validate or sanitize the <code>fileids</code> parameter used in its corpus reading methods (e.g., <code>header</code>, <code>raw</code>, <code>words</code>). Instead of utilizing the <code>nltk.pathsec</code> security framework, which is designed to prevent directory traversal and enforce strict access control, <code>NKJPCorpusReader</code> relies on insecure string concatenation to build file paths and subsequently invokes Python's built-in <code>open()</code> function.</p>
<p>This architectural flaw persists even when <code>nltk.pathsec.ENFORCE = True</code> is set, a configuration specifically intended to protect multi-tenant and web-based applications from unauthorized file system access. An attacker capable of influencing the input to these methods can escape the intended corpus directory, leading to unauthorized disclosure of sensitive files on the host system. The vulnerability affects a wide range of NLTK corpus readers that share the same insecure pattern of using raw file operations over the provided security API.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies an application endpoint or script that accepts user-supplied input used as a <code>fileids</code> argument for NLTK's <code>NKJPCorpusReader</code>.</li>
<li>Attacker crafts a malicious path string containing directory traversal sequences (e.g., <code>../../../../</code>) to escape the configured corpus root directory.</li>
<li>The application passes the malicious string into the <code>NKJPCorpusReader.header()</code> or related corpus reading method.</li>
<li><code>NKJPCorpusReader</code> performs plain string concatenation of the corpus root and the attacker-controlled <code>fileids</code> without normalization or security validation.</li>
<li>The resulting path points to a sensitive file on the host filesystem (e.g., <code>/etc/passwd</code> or configuration files).</li>
<li>The <code>NKJPCorpusReader</code> method calls the Python built-in <code>open()</code> function directly with the resolved malicious path.</li>
<li>The <code>nltk.pathsec</code> sandbox is never consulted, bypassing the <code>ENFORCE=True</code> security configuration.</li>
<li>The application returns the content of the unintended file to the attacker, resulting in unauthorized data exfiltration.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows for the arbitrary reading of files on the host operating system with the privileges of the service account running the NLTK-based application. This poses a significant risk to web and multi-tenant environments where NLTK is utilized to process untrusted user input. Exposure of local configuration files, API keys, or system credentials could lead to full system compromise. The vulnerability affects any software utilizing NLTK &lt;= 3.9.4 for corpus analysis.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Update NLTK to the latest version once a patch is released that addresses the <code>NKJPCorpusReader</code> path validation logic.</li>
<li>Implement strict input validation for any user-controlled data intended to act as a file path or identifier within NLTK readers.</li>
<li>Audit application code for any custom use of <code>os.path.join</code> or string concatenation when constructing file paths passed to NLTK corpus objects, ensuring that <code>FileSystemPathPointer.open()</code> is used instead of the built-in <code>open()</code>.</li>
<li>Restrict the privileges of the system user running the NLTK-dependent application to the minimum necessary directory access using OS-level controls (e.g., AppArmor, SELinux, or container volume restrictions).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>path-traversal</category><category>cve-2026-12072</category><category>library-vulnerability</category></item></channel></rss>