/

CVE-2026-78682

Severity:

HIGH RISK

(7.5)

Server-Side Request Forgery (CWE-918) in NLTK Proxy Handling

CVE-2026-78682

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Internal Resource Access and Malicious Content Installation

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

NLTK contains a server-side request forgery vulnerability in its URL-fetching and downloader pathways when an HTTP proxy is configured. An attacker who can provide a URL to these components may cause the proxy to request internal services that local hostname validation would otherwise reject, potentially exposing internal resources or retrieving attacker-controlled package metadata and content.

Affected context

The issue can occur in NLTK deployments that use nltk.pathsec.urlopen or callers such as nltk.data.load and nltk.downloader.Downloader, while an HTTP proxy is configured. Local validation may approve a public destination, but inherited proxy-handler behavior can cause the proxy to perform the actual request without applying equivalent destination validation.

Exploit preconditions

  • Attack surface: NLTK URL-fetching, data-loading, or downloader functionality
  • Required access: Ability to supply or influence a URL processed by an affected NLTK component
  • Environmental condition: An HTTP proxy must be configured and reachable by the NLTK process
  • Trigger point: The proxied HTTP or HTTPS request performed after local hostname validation
  • Why exploitation is possible: The application validates the original requested hostname, while the proxy can forward the request to a different internal destination that is not re-validated

Why this happens

The vulnerability results from a mismatch between application-side URL validation and proxy-side request execution. NLTK validates the requested hostname locally, but proxy-handler inheritance disables the safe HTTP and HTTPS handlers, allowing the configured proxy to resolve and contact a destination that was not covered by the original validation. This is a form of CWE-918: Server-Side Request Forgery, where attacker-influenced server requests can reach unintended internal or protected resources.

Potential impact

  • An attacker could disclose HTTP resources available only from internal networks
  • An attacker could access loopback-only or otherwise restricted services
  • An attacker could provide forged downloader indexes
  • NLTK could install attacker-chosen package or data content
  • Applications could experience data poisoning or supply-chain compromise

General mitigation guidance

Mitigation generally focuses on enforcing destination controls at the point where the final network request is made, including when traffic passes through a proxy.

Common defensive patterns include:

  • Using request handling that preserves safe HTTP and HTTPS validation for proxied traffic
  • Applying allowlists for schemes, hosts, ports, resolved addresses, and redirect destinations
  • Blocking loopback, link-local, private, and other reserved address ranges after resolution
  • Separating downloader permissions from general application privileges
  • Treating downloaded indexes and package content as untrusted until integrity and provenance checks succeed
  • Restricting proxy egress and preventing access to internal administrative services
  • Avoiding automatic installation or execution of content retrieved from untrusted endpoints

How teams detect issues like this

Organizations can look for SSRF exposure through:

  • Static analysis of URL validation followed by proxy-aware network requests
  • Code review signals such as validation of the original hostname without validation after redirects, resolution, or proxy forwarding
  • Tests covering loopback, private, link-local, reserved, and unusual address representations
  • Configuration audits for unrestricted outbound proxies and downloader permissions
  • Network monitoring for application processes contacting internal address ranges through proxies
  • Policy enforcement requiring destination allowlists and content integrity validation

Automated security review tools may help identify unsafe URL-fetching patterns, but runtime proxy behavior should also be tested.

Sources

SourceLink
github.comgithub.com/nltk/nltk/security/advisories/GHSA-6ww7-3frv-cqxh
vulncheck.comvulncheck.com/advisories/nltk-before-ssrf-protection-bypass-via-proxy

Frequently asked

questions

It can be exploitable through a network-facing application or service that passes attacker-influenced URLs to affected NLTK functionality, provided the process uses a reachable HTTP proxy.

Not necessarily. The key requirement is the ability to influence a URL processed by the affected loader or downloader, along with a proxy configuration that permits the resulting request.

Ensure that the final destination remains subject to strict allowlisting and private-address blocking even when requests are sent through a proxy, and avoid automatic retrieval or installation from untrusted locations.

Combine proxy-aware URL validation with restricted egress, redirect and DNS-resolution checks, least-privilege downloader execution, and integrity verification for retrieved indexes and package content.

Find out what's already
exploitable in your codebase.