Skip to content
Medium 6.1

NLTK: AllowlistUnpickler does not deny numpy submodule-local file-I/O sinks

CVE-2026-128136 First seen on SecPulse

Affected packages

PackageAffected → Fixed
nltknltk —
PyPInltk
≥ 3.10.0, < 3.10.4→ 3.10.4
pipnltk
< 3.10.4→ 3.10.4

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

Summary

nltk.picklesec.allowlisted_pickle_load keyed its denylist of dangerous globals by export name, so numpy's file-I/O callables that live in submodules and are not re-exported under __module__ == "numpy" were never matched. Under the broad allowed_modules=("numpy", "scipy", "sklearn") allowance that TransitionParser.parse(depgraphs, modelFile) granted for model files, a crafted protocol 4 pickle could name numpy.lib._npyio_impl.recfromtxt (arbitrary file read, result returned to the caller of allowlisted_pickle_load) or numpy.lib.format.open_memmap (attacker-chosen file create), and the REDUCE opcode invoked them during the load.

Affected

nltk >= 3.10.0 and <= 3.10.3 (the allowlisting unpickler and the TransitionParser model path); numpy must be installed.

Reproduction

A pickle whose REDUCE names numpy.lib._npyio_impl.recfromtxt with a target path, loaded through allowlisted_pickle_load(data, allowed_modules=("numpy",)), reads that file on v3.10.3; one naming numpy.lib.format.open_memmap with mode w+ creates a file. Both are refused on develop with UnpicklingError: global '...' is from a denied module. The maintainer transcript below shows the before and after runs.

Impact

File read and file create on the host that loads an untrusted model through NLTK's allowlisting unpickler. No code execution: this sits below the TransitionParser code-execution sibling GHSA-m396-3h67-vpfv, which is why the severity was reassessed to M…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details