Advisories for Pypi/Stanza package

2026

Stanza: RCE via pickle deserialization in the lemmatizer

TL;DR Loading an attacker-supplied lemma .pt runs arbitrary code as the loading user. Since 1.14.0 the lemmatizer stores pos_dict as a gzip-compressed pickle in the checkpoint's dicts field (a bytes value). torch.load(weights_only=True) treats bytes as a primitive and passes it through unexamined, so its allowlist never sees the inner stream. Trainer.load then feeds those bytes to an unrestricted pickle.loads: the only bare pickle.loads in the tree. Result: weights_only=True gives no …

Stanza: Remote Code Execution via Unsafe Pickle Deserialization in Model Loaders

Stanza 1.12.0 attempts to safely load PyTorch checkpoint files using torch.load(…, weights_only=True), but automatically falls back to the fully unsafe torch.load(…, weights_only=False) when the safe load raises pickle.UnpicklingError. Because the UnpicklingError condition is fully attacker-controllable, any .pt file that contains a single unsupported pickle global will trigger it. An attacker who can place a malicious pretrain or model file on disk (via supply-chain compromise, a poisoned model repository, or a …