Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. nltk
  4. ›
  5. CVE-2026-63311

CVE-2026-63311: NLTK: SSRF Fail-Open in validate_network_url() via DNS Resolution Failure

September 2, 2026

There is an SSRF vulnerability in NLTK 3.9.4’s network URL validation. The validate_network_url() function in nltk/pathsec.py fails open when DNS resolution returns an error.

The _resolve_hostname() helper at lines 193-234 catches OSError and ValueError during socket.getaddrinfo() and returns an empty list []. When this happens, the validation loop in validate_network_url() iterates over nothing (for addr in resolved: … never executes), with no else/fallback check. The function returns normally, and urlopen() proceeds to make the request without any IP validation.

This means:

  1. If DNS is temporarily unavailable, ALL SSRF protections are disabled
  2. DNS rebinding attacks bypass the check after the LRU cache entry expires
  3. In environments with unreliable resolvers, the protection is permanently bypassed

PoC:

import nltk.pathsec
import unittest.mock

References

  • github.com/advisories/GHSA-3gqm-fcw5-w839
  • github.com/nltk/nltk/commit/4a820afa58810cd05049b6c6eae306694d6cfe65
  • github.com/nltk/nltk/pull/3582
  • github.com/nltk/nltk/releases/tag/v3.10.0
  • github.com/nltk/nltk/security/advisories/GHSA-3gqm-fcw5-w839
  • github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3723.yaml
  • nvd.nist.gov/vuln/detail/CVE-2026-63311
  • www.vulncheck.com/advisories/nltk-before-ssrf-via-dns-resolution-failure

Code Behaviors & Features

Detect and mitigate CVE-2026-63311 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.10.0

Fixed versions

  • 3.10.0

Solution

Upgrade to version 3.10.0 or above.

Impact 8.3 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-918: Server-Side Request Forgery (SSRF)

Source file

pypi/nltk/CVE-2026-63311.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 05 Sep 2026 12:16:34 +0000.