NLTK network URL validation permits SSRF to RFC 6598 shared-address-space hosts
What fixes it
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
A Server-Side Request Forgery (SSRF) vulnerability exists in nltk/nltk versions 3.9.4 and the current develop branch. The nltk.pathsec.validate_network_url() function, intended to prevent SSRF by rejecting internal network addresses, fails to reject IPs in the RFC 6598 shared address space (100.64.0.0/10). This occurs because Python's ipaddress module does not classify such addresses as is_private or is_global, and the current guard only checks is_private and a few explicit categories. An attacker who can influence a URL passed to NLTK's network-loading helpers can exploit this vulnerability to make a strict-mode application send requests to shared-address-space hosts, potentially exposing non-public infrastructure reachable from the application host. The impact is limited to SSRF-style confidentiality exposure, with no code execution claimed.
Text from CVE List
Affected versions 53
- nltk, pip< 3.10.0GitHub
- nltk/nltkaffected: unspecified through latestCVE List
- nltk, PyPIfrom first release, fixed in 3.10.0OSV
- nltk, PyPI0.8OSV
- nltk, PyPI0.9OSV
- nltk, PyPI0.9.3OSV
- nltk, PyPI0.9.4OSV
- nltk, PyPI0.9.5OSV
- nltk, PyPI0.9.6OSV
- nltk, PyPI0.9.7OSV
- nltk, PyPI0.9.8OSV
- nltk, PyPI0.9.9OSV
- nltk, PyPI2.0.1OSV
- nltk, PyPI2.0.1rc1OSV
- nltk, PyPI2.0.1rc2-gitOSV
- nltk, PyPI2.0.1rc3OSV
- nltk, PyPI2.0.1rc4OSV
- nltk, PyPI2.0.2OSV
- nltk, PyPI2.0.3OSV
- nltk, PyPI2.0.4OSV
- nltk, PyPI2.0.5OSV
- nltk, PyPI2.0b4OSV
- nltk, PyPI2.0b5OSV
- nltk, PyPI2.0b6OSV
- nltk, PyPI2.0b7OSV
- nltk, PyPI2.0b8OSV
- nltk, PyPI2.0b9OSV
- nltk, PyPI3.0.0OSV
- nltk, PyPI3.0.0b1OSV
- nltk, PyPI3.0.0b2OSV
- nltk, PyPI3.0.1OSV
- nltk, PyPI3.0.2OSV
- nltk, PyPI3.0.3OSV
- nltk, PyPI3.0.4OSV
- nltk, PyPI3.0.5OSV
- nltk, PyPI3.1OSV
- nltk, PyPI3.2OSV
- nltk, PyPI3.2.1OSV
- nltk, PyPI3.2.2OSV
- nltk, PyPI3.2.3OSV
- nltk, PyPI3.2.4OSV
- nltk, PyPI3.2.5OSV
- nltk, PyPI3.3OSV
- nltk, PyPI3.4OSV
- nltk, PyPI3.4.1OSV
- nltk, PyPI3.4.2OSV
- nltk, PyPI3.4.3OSV
- nltk, PyPI3.4.4OSV
- nltk, PyPI3.4.5OSV
- nltk, PyPI3.5OSV
- nltk, PyPI3.5b1OSV
- nltk, PyPI3.6OSV
- nltk, PyPI3.6.1OSV
References 6
- github.com/nltk/nltk/commit/4a820afa58810cd05049b6c6eae306694d6cfe65Fixvia GitHub
- github.com/nltk/nltk/releases/tag/v3.10.0Fixvia GitHub
- github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3955.yamlAdvisoryvia GitHub
- github.com/advisories/GHSA-2jhm-w3mp-jcwrAdvisoryvia GitHub
- huntr.com/bounties/2911b643-571c-42e4-b0c2-9a1fa6f491dbExploitvia CVE List
- nvd.nist.gov/vuln/detail/CVE-2026-12372Referencevia GitHub