NLTK ZIP extraction flaw lets local users overwrite files outside data root
- NLTK
- hardlink
- extraction

Flaw affects package installation process in versions 3.9.4 through 3.10.3
Local actors could exploit hardlinks to modify files outside the data root
The advisory conflicts on whether version 3.10.4 fixes the issue
NLTK’s ZIP package extraction process can let a local user overwrite files outside the library’s intended data root, according to a security advisory. The issue affects versions 3.9.4 through 3.10.3.
The advisory says NLTK’s nltk.pathsec.ZipFile wrapper does not check whether an archive member’s destination is a hardlink to a file outside the data root. A local user with write access to a shared or predictable data root can place a hardlink at a path that a later package download will write to. Extraction then truncates and overwrites the linked file outside the root.
Exploitation requires either disabled kernel hardlink protection or permission for the person creating the link to link to the target file. The reported impact is destruction of a file outside the data root; the advisory says the affected file’s contents could be attacker-chosen in some circumstances, but does not demonstrate that outcome.
The advisory gives conflicting information about the fix: one section lists version 3.10.4 as patched, while another says no fixed version exists and identifies 3.10.3 as the latest affected release. It therefore does not establish a confirmed fixed version.




