GitHub advisory · PyPI
NLTK: Stable FrameNet and NKJP readers parse outside-root XML
Description
Published nltk==3.9.4 still contains several XML-reader entrypoints that build parser paths from caller-controlled selectors or trusted-looking index state without preserving the corpus-root boundary.
FramenetCorpusReader.frame_by_name, FramenetCorpusReader.doc, FramenetCorpusReader.lu, NKJPCorpusReader.header3.9.4 reproduced. Current source v3.10.0-rc2 acted as a negative control and blocked the same payloads.I confirmed four public stable entrypoints return parsed outside-root content: a parent-segment traversal frame name, a poisoned fulltext index filename, a poisoned LU id, and an unsafe NKJP header file identifier. Current source rejects the same payloads with explicit path-safety errors, which shows the bug is real but version-scoped to the published stable package.
Preconditions
Steps
3.9.4 APIs.frame_by_name, doc, lu(...).exemplars, or header return parsed outside-root values.Minimal reproducible excerpt
framenet_frame_definition FRAME_LEAK
framenet_doc_text DOC_LEAK
framenet_lu_text LU_LEAK
nkjp_header_title HEADER_LEAK
Applications that process attacker-influenced…
Manual fix · PyPI
pip install --upgrade "nltk>=3.10.0"Sources