CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-63311

CVE-2026-63311: Server-Side Request Forgery and DNS Rebinding in Natural Language Toolkit (NLTK)

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 2, 2026·6 min read·23 visits

Executive Summary (TL;DR)

NLTK versions prior to 3.10.0 are vulnerable to Server-Side Request Forgery (SSRF) and DNS rebinding. Due to fail-open exception handling in DNS resolution and a lack of IP pinning, security checks on remote URLs can be completely bypassed by attackers controlling the target server or domain.

A vulnerability in the Natural Language Toolkit (NLTK) before version 3.10.0 allowed attackers to bypass SSRF filters via DNS resolution failures and DNS rebinding. By exploiting these weaknesses, unauthenticated remote attackers could coerce hosting systems into scanning internal networks or accessing sensitive cloud metadata endpoints.

Vulnerability Overview

The Natural Language Toolkit (NLTK) is a widely used Python library for processing human language data. In versions prior to 3.10.0, NLTK implemented a security sentinel in nltk/pathsec.py designed to filter outbound network connections. This filter aimed to prevent Server-Side Request Forgery (SSRF) and local directory traversal attacks during resource fetching.

The target attack surface consists of functions that dynamically fetch remote data, such as nltk.download() or nltk.data.load(). When these functions receive user-supplied URLs, they rely on the validation module to block malicious requests. The original implementation attempted to verify hostnames prior to establishing HTTP connections, but contained fatal logic design flaws.

Two critical weaknesses undermine the filter's security guarantees. First, the DNS validation loop fails open if the DNS query encounters an exception. Second, the absence of socket-level IP pinning allows Time-of-Check to Time-of-Use (TOCTOU) DNS rebinding attacks. These weaknesses allow an unauthenticated attacker to route HTTP requests to internal subnets, local loopback interfaces, or cloud provider metadata endpoints.

Root Cause Analysis

The root cause of the vulnerability lies in the implementation of the validate_network_url() function in nltk/pathsec.py. The function attempts to resolve target hostnames and verify that the corresponding IP addresses do not belong to private, loopback, or multicast ranges.

The first critical vulnerability involves fail-open error handling in the DNS resolver. The helper function _resolve_hostname() wraps socket.getaddrinfo() inside a try-except block. If the DNS query fails due to a network timeout, an invalid hostname format, or a deliberate DNS resolution error, the function catches the exception and returns an empty list.

@lru_cache(maxsize=256)
def _resolve_hostname(hostname):
    try:
        return socket.getaddrinfo(hostname, None, proto=socket.IPPROTO_TCP)
    except (OSError, ValueError):
        return []

Because the resolver returns an empty list, the verification loop in the calling function executes zero iterations. No IP addresses are evaluated against the forbidden lists, and the validation completes successfully without raising any security exceptions. The application then proceeds to establish a network connection using urllib.request.urlopen().

The second critical flaw is a Time-of-Check to Time-of-Use (TOCTOU) race condition. Even when DNS resolution succeeds, the validated IP address is never pinned to the actual HTTP request. The library validates the IP during the check stage, but the underlying HTTP client performs a separate DNS resolution when establishing the TCP socket. This architecture permits DNS rebinding, where an attacker-controlled DNS server yields a safe IP during validation and a local IP during execution.

Code and Patch Analysis

The security patch introduced in NLTK version 3.10.0 completely replaces the vulnerable pre-check validation logic with active socket-level IP pinning. The patch intercepts connection attempts to force the application to connect exclusively to the specific, validated IP addresses.

# Patched implementation of host resolution and validation
def _resolve_and_validate_host(host, port):
    try:
        addrinfo = socket.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)
    except (OSError, ValueError):
        # FAIL CLOSED: Resolution failures now abort the request
        return []
    
    validated = []
    for res in addrinfo:
        ip_str = res[4][0]
        ip = ipaddress.ip_address(ip_str)
        if _ip_is_forbidden(ip):
            # Explicitly block access to local, private, or non-global routes
            raise PermissionError(f"SSRF attempt to blocked IP {ip_str}")
        validated.append(res)
    return validated

The patched library subclasses http.client.HTTPConnection and http.client.HTTPSConnection to implement safe connections. When making a connection, the custom handler resolves the hostname, validates every returned IP address, and establishes the TCP socket directly using the numeric IP. This avoids the second DNS lookup, neutralizing the TOCTOU rebinding vector.

This fix is highly complete and robust. It addresses the architectural flaws of the previous implementation by eliminating the split-resolution pattern and ensuring that DNS resolution failures result in a hard failure rather than a silent bypass.

Exploitation Methodology

Exploitation of CVE-2026-63311 requires the attacker to influence the URL parameter passed to NLTK's data-fetching functions. The attack vector depends on whether the target application accepts user-specified download mirrors or directly parses documents containing resource links.

In a DNS rebinding attack, the adversary registers a custom domain (such as rebind.attacker.com) and configures an authoritative DNS server under their control. The DNS server is programmed to alternate its responses or set the Time-To-Live (TTL) value of the record to 0. This ensures that the server does not allow downstream caching of the resolved IP.

When NLTK processes the input URL, the validation engine queries the DNS server. The DNS server returns a public IP address. The validation check evaluates this public IP, determines it is safe, and permits execution. Immediately afterward, the HTTP connection client requests resolution again. The DNS server now returns 127.0.0.1 or 169.254.169.254, forcing the application server to connect to its own local services or its cloud provider's metadata endpoint.

Impact Assessment

The impact of successful exploitation depends heavily on the execution environment. In cloud-deployed applications, such as Python services running on AWS, GCP, or Azure, the vulnerability provides a direct pathway to compromise the host. Attackers can query the cloud provider metadata service to retrieve sensitive IAM credentials, internal service configurations, and authentication tokens.

When deployed within internal networks, the vulnerability transforms the host application into an open proxy. Attackers can conduct internal port scanning and send unauthorized HTTP GET requests to local databases, cache systems, or internal APIs that trust requests originating from localhost. The vulnerability does not directly support arbitrary file writing or command execution, but can be chained with other local vulnerabilities to achieve Remote Code Execution (RCE).

The CVSS v4.0 base score is rated at 6.9, reflecting network-based, low-complexity attacks that require no prior privileges or user interaction. The impact is primarily categorized as low integrity and low confidentiality, because the standard urllib implementation limits the attacker to read-only HTTP GET requests without the ability to modify server state directly via other methods.

Remediation and Defenses

The primary remediation strategy is upgrading the NLTK installation to version 3.10.0 or higher. This upgrade can be performed via the standard package management utilities. The updated library contains the socket-level pinning modifications that neutralize both the fail-open and DNS-rebinding behaviors.

pip install --upgrade nltk>=3.10.0

If patching the software dependency is not immediately feasible, organizations should implement host-level or network-level firewall rules. Administrators can block outbound HTTP/HTTPS requests from the application server to private subnets (RFC 1918) and the cloud metadata range (169.254.169.254/32). These egress blocks prevent successful exploitation even if the library continues to permit the requests.

Furthermore, local DNS resolvers can be configured to drop responses that resolve external domains to private IP addresses. Implementing anti-DNS-rebinding filters at the resolver level provides a robust layer of defense against this class of vulnerabilities across the entire infrastructure.

Official Patches

nltkOfficial fix commit implementing safe connection mechanics
nltkRelease notes and binaries for NLTK version 3.10.0 containing the fix

Fix Analysis (1)

Technical Appendix

CVSS Score
6.9/ 10
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
EPSS Probability
0.24%
Top 85% most exploited

Affected Systems

Python environments utilizing the nltk library

Affected Versions Detail

Product
Affected Versions
Fixed Version
nltk
nltk
< 3.10.03.10.0
AttributeDetail
CWE IDCWE-918
Attack VectorNetwork
CVSS v4.0 Score6.9
EPSS Score0.00241
Exploit StatusProof of Concept
CISA KEV StatusNo

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1005Data from Local System
Collection
CWE-918
Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

Known Exploits & Detection

NLTK Project Pull Request #3582Contains regression tests illustrating the bypass of host validation using mock DNS servers and custom resolution pipelines.

Vulnerability Timeline

Vulnerability identified and patch merged into NLTK codebase
2026-06-06
CVE-2026-63311 and GHSA-3gqm-fcw5-w839 publicly disclosed
2026-08-22
National Vulnerability Database analysis completed
2026-08-27

References & Sources

  • [1]GitHub Security Advisory GHSA-3gqm-fcw5-w839
  • [2]NVD Vulnerability Page for CVE-2026-63311
  • [3]VulnCheck Security Advisory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-11748
6.9

CVE-2026-11748: Unauthenticated LDAP Injection in Central Dogma Server Authentication

An LDAP injection vulnerability exists in the centraldogma-server-auth-shiro module of LY Corporation Central Dogma before version 0.84.0. The search logic dynamically constructs LDAP search filters by interpolating user-provided usernames without escaping RFC 4515 metacharacters. Unauthenticated remote attackers can leverage this flaw to bypass authentication, enumerate directory hierarchies, and access unauthorized resources.

Alon Barad
Alon Barad
9 views•6 min read
•1 day ago•CVE-2026-11746
9.4

CVE-2026-11746: Use of Hard-coded ZooKeeper Replication Secret 'ch4n63m3' in Central Dogma Server

CVE-2026-11746 is a critical vulnerability in Central Dogma Server prior to version 0.84.0, where an embedded ZooKeeper replication secret silently falls back to a publicly known, hard-coded default string ('ch4n63m3'). Remote attackers with access to the replication network can authenticate as legitimate cluster peers, potentially leading to unauthorized data exposure, state manipulation, or complete cluster takeover.

Amit Schendel
Amit Schendel
7 views•6 min read
•1 day ago•CVE-2026-56665
4.2

CVE-2026-56665: Logical Validation Bypass in ZITADEL External JWT Identity Provider

A logical verification flaw in ZITADEL's external JWT Identity Provider validation allows attackers to bypass session expiration checks. If an incoming JWT lacks the 'exp' claim, the system skips validation entirely, creating an indefinitely valid session. This issue has been addressed in versions 3.4.12 and 4.15.2.

Alon Barad
Alon Barad
6 views•7 min read
•1 day ago•CVE-2026-59149
6.5

CVE-2026-59149: Sibling Directory Path Traversal in Mockoon Backend Server

CVE-2026-59149 identifies a directory traversal vulnerability in `@mockoon/commons-server`, the backend mock-server library powering the Mockoon application. The flaw occurs in the path containment validation logic used during raw file response generation. An unauthenticated attacker can exploit this weakness to retrieve arbitrary files from sibling directories sharing a common prefix with the designated static base directory.

Amit Schendel
Amit Schendel
9 views•5 min read
•1 day ago•CVE-2026-59148
8.8

CVE-2026-59148: Unauthenticated Administrative API and CORS Misconfiguration in Mockoon

An in-depth analysis of CVE-2026-59148, a high-severity flaw in Mockoon where unauthenticated administrative endpoints and a wildcard Cross-Origin Resource Sharing (CORS) policy allow remote execution, state poisoning, and credential theft.

Alon Barad
Alon Barad
11 views•6 min read
•1 day ago•CVE-2026-56666
4.8

CVE-2026-56666: Account Takeover via Improper Email Verification in ZITADEL Federated Identity Handler

An improper authentication vulnerability (CWE-287) in ZITADEL's external identity provider handler before version 4.15.3 allows remote attackers to perform complete account takeover. When auto-linking by email is enabled, ZITADEL verifies that the local target account has a verified email address but fails to verify if the external provider confirmed ownership of that same email. Attackers can exploit this by registering an unverified account with a victim's email address on a permissive external provider, leading to unauthorized account binding and persistent access.

Amit Schendel
Amit Schendel
7 views•7 min read