PyPI: nltk

CVE-2026-33230

Safety vulnerability ID: SFTY-20260318-07212

Safety legacy ID: pyup.io-89824

Affected versions of the nltk package are vulnerable to Cross-site Scripting (XSS) due to improper output encoding of user-controlled input. In nltk.app.wordnet_app, requests to the lookup_... route are processed through page_from_href() and page_from_reference(), where the decoded word value is inserted into the HTML response without html.escape(), specifically in the "The word or words '%s' were not found in the dictionary." % word code path.

Created at: Mar 25, 2026Updated at: Mar 25, 2026

Overview

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in nltk

Advisory

Affected versions of the nltk package are vulnerable to Cross-site Scripting (XSS) due to improper output encoding of user-controlled input. In nltk.app.wordnet_app, requests to the lookup_... route are processed through page_from_href() and page_from_reference(), where the decoded word value is inserted into the HTML response without html.escape(), specifically in the "The word or words '%s' were not found in the dictionary." % word code path.

Affected Package

Affecting nltk package, versions
<=3.9.3

Also affects

---

How to Fix

Upgrade
nltk
to
3.9.4
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more