Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted hostname URL to NLTK-consuming application
-
DeliveryEngineer DNS resolution failure (NXDOMAIN or OSError) for that hostname
-
Exploit_resolve_hostname() returns empty list, validation loop runs zero iterations
-
Executionvalidate_network_url() exits without blocking, urlopen() executes
-
PersistDNS rebinding or redirect routes request to 169.254.169.254
-
ImpactRetrieve cloud instance metadata and IAM credentials
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Credential Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires all three of the following: (1) the target application must invoke NLTK's validate_network_url() function or a higher-level NLTK function that calls it, with a URL value that the attacker can influence - NLTK itself is a library and does not expose a network service, so the application's exposure surface determines whether this condition is met; (2) the attacker must be able to engineer a DNS resolution failure for the supplied hostname (e.g., by supplying a domain returning NXDOMAIN, or controlling DNS to produce an OSError or ValueError from socket.getaddrinfo()) or execute a DNS rebinding attack where a domain resolves to a permitted public IP during validation but to a restricted internal IP at request time; (3) for the highest-impact scenario, the deployment environment must have a reachable link-local metadata endpoint (169.254.169.254) without IMDSv2 or equivalent enforcement. Exploitation is bounded by the requirement to influence URL input into NLTK functions, the need for DNS control or the ability to cause deliberate resolution failures, and the absence of network-layer egress filtering on the host process. |
| Impact | The vendor-supplied CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L) yields a score of 6.9, characterizing this as a remotely exploitable, low-complexity flaw with no authentication requirement and collateral impact on subsequent systems. The low-complexity rating is worth scrutiny: DNS rebinding requires the attacker to control DNS infrastructure for a domain and engineer precise timing windows, which is non-trivial; however, simply using a hostname that produces a DNS resolution failure (e.g., NXDOMAIN, or triggering an OSError/ValueError from socket.getaddrinfo()) may be considerably easier and lowers the practical bar. No EPSS data was provided, no CISA KEV listing exists, and no proof-of-concept exploit has been identified - all signals that reduce immediate mass-exploitation risk. However, for cloud-deployed applications that expose NLTK network-fetch functionality to user-supplied input, the real-world risk is meaningfully higher than the moderate CVSS score implies: successful exploitation targeting 169.254.169.254 in AWS, GCP, or Azure environments without IMDSv2 enforcement can yield IAM role credentials and enable privilege escalation. In non-cloud environments or deployments where NLTK is not exposed to attacker-influenced URL input, practical risk is low. |
| Exploit ScenarioDerived | An attacker submits a crafted URL referencing a hostname they control to a web application that passes user-supplied URLs into an NLTK network-fetch function. By configuring that hostname to return NXDOMAIN or otherwise trigger an OSError in socket.getaddrinfo(), the SSRF validation in validate_network_url() iterates an empty list, performs no IP checks, and allows urlopen() to proceed. The attacker then uses a redirect or DNS rebinding technique to resolve the hostname to 169.254.169.254 at request time, retrieving AWS instance metadata including attached IAM role credentials. No public proof-of-concept has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 22, 2026
SSRF protection bypass in NLTK affects all versions before 3.10.0, where a fail-open logic error in validate_network_url() allows attackers to reach restricted network resources including cloud metadata endpoints such as 169.254.169.254. The flaw resides in _resolve_hostname(), which silently swallows OSError and ValueError from socket.getaddrinfo() and returns an empty list; the subsequent IP validation loop then iterates zero times, allowing urlopen() to execute the request with no filtering applied. No public exploit code or CISA KEV listing has been identified at time of analysis, but the real-world impact is meaningfully elevated for cloud-deployed applications where metadata API access can expose IAM credentials.
RemediationAI
Upgrade NLTK to version 3.10.0, which contains the vendor-released patch correcting the fail-open behavior in _resolve_hostname(). The vendor advisory at https://github.com/nltk/nltk/security/advisories/GHSA-3gqm-fcw5-w839 should be consulted for full release notes and any additional guidance. Where immediate upgrade is not feasible, deploy egress firewall rules or network policies on the host running NLTK to block outbound traffic to link-local ranges (169.254.0.0/16) and RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16); this prevents the highest-impact metadata endpoint scenario without fixing the underlying logic flaw, and may break legitimate private-network use cases if any exist. Additionally, audit all application code paths that pass user-controlled or externally sourced URLs into NLTK network functions and add an application-layer allowlist as a defense-in-depth measure. Cloud deployments should enforce IMDSv2 (AWS) or equivalent metadata API hardening that requires a session-oriented PUT request, which simple SSRF cannot satisfy.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
NLTK (Natural Language Toolkit), identified by CPE cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*, is a widely-used Python library for natural language processing tasks used in research and production. The vulnerability (CWE-918 - Server-Side Request Forgery) lives in nltk/pathsec.py inside validate_network_url(), which is responsible for blocking requests to private, loopback, and link-local IP ranges before delegating to urllib's urlopen(). The _resolve_hostname() helper calls socket.getaddrinfo() to resolve a hostname to IP addresses, then checks each resolved address against a blocklist. The defect is in the exception handler: when socket.getaddrinfo() raises OSError (e.g., NXDOMAIN, network timeout) or ValueError, _resolve_hostname() catches the exception silently and returns an empty list rather than raising an error or refusing the request. Because validate_network_url() iterates over the returned list to perform IP checks, an empty list results in zero iterations and the function exits without blocking - a textbook 'fail open' security error. Python's urlopen() then executes against the original user-supplied URL with SSRF protections entirely bypassed.
Know when Nltk gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L
AC:H for DNS rebinding or engineered resolution failure prerequisite; S:C and C:L/I:L reflect cross-boundary access to cloud metadata and internal services.
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
NLTK before 3.10.0 (affected versions <= 3.9.4) contains a server-side request forgery (SSRF) vulnerability in the validate_network_url() function in nltk/pathsec.py. The _resolve_hostname() helper catches OSError and ValueError during socket.getaddrinfo() and returns an empty list; when DNS resolution fails, the validation loop executes no IP checks and the function fails open, allowing urlopen() to proceed without validation. An attacker who can trigger DNS resolution failures or use DNS rebinding can bypass SSRF protections and reach restricted network resources, including cloud metadata endpoints (e.g., 169.254.169.254).
Blast Radius
ecosystem impact- 6 pypi packages depend on nltk (6 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.10.0.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.
Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p
Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic
Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow
StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc
Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to
Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers
Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse
XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s
Server-side request forgery in NLTK before 3.10.3 allows unauthenticated remote attackers to reach internal HTTP service
Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpu
Path traversal in NLTK's FramenetCorpusReader and NKJPCorpusReader (all versions before 3.10.0) enables unauthenticated
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research a
EUVD-2026-64334
GHSA-3gqm-fcw5-w839
NVD
CVE.org
EPSS
VulDB
Exploit-DB