Skip to content
HighVulnerability

GHSA-p4gq-832x-fm9v: Natural Language Toolkit (NLTK): URL-Encoded Path Traversal in nltk.data.load() Allows Arbitrary Local File Read

Published
Record updated
View JSON
Affected
  • nltk <= 3.9.4
Fixed in
No fixed version was stated when the source was last read.
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.6%

Summary

NLTK's nltk.data.load() and find() functions allow path traversal through the nltk: URL scheme, letting an attacker read arbitrary local files. The _UNSAFE_NO_PROTOCOL_RE regex check runs on the raw resource string before url2pathname() decodes %xx sequences, so encoded separators and dot segments such as %2fetc%2fpasswd bypass it. The issue is tracked as CWE-22 and affects NLTK 3.9.4 and earlier under the default ENFORCE=False configuration.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.