/

CVE-2026-115878

Severity:

HIGH RISK

(7.8)

Unsafe Deserialization (CWE-502) in Stanza Lemmatizer

CVE-2026-115878

Awaiting Analysis

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-94, CWE-502

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Stanza can execute arbitrary code when it loads a lemmatizer checkpoint containing attacker-controlled, gzip-compressed pickle data. The risk arises when a caller-influenced checkpoint path is used during pipeline construction, before inference begins.

Affected context

The issue affects Stanza's lemmatizer checkpoint-loading path in versions 1.14.0 through versions before 1.15.0. During pipeline construction, a caller-influenced lemma_model_path can lead the trainer to decompress pos_dict data and pass it to unrestricted pickle.loads. The outer torch.load allowlist does not inspect this nested pickle data.

Exploit preconditions

  • Attack surface: Stanza pipeline construction and lemmatizer checkpoint loading
  • Required access: Ability to provide or influence the checkpoint loaded through lemma_model_path
  • Trigger point: The lemmatizer trainer loads and decompresses the checkpoint's pos_dict during pipeline setup
  • Why exploitation is possible: The decompressed bytes are passed to unrestricted pickle.loads, which can execute code while deserializing attacker-controlled data

Why this happens

The checkpoint stores pos_dict as gzip-compressed pickle bytes, which are later passed to unrestricted pickle.loads. Pickle deserialization can invoke behavior encoded in the input, so treating a checkpoint as trusted data creates an unsafe deserialization flaw (CWE-502). The outer torch.load setting does not make nested pickle data safe; the code-execution consequence is also related to CWE-94: Improper Control of Generation of Code.

Potential impact

  • Attacker-controlled checkpoint data may execute arbitrary code in the Stanza process.
  • The process's accessible data, credentials, or connected services could be exposed or modified.
  • A compromised process may be used to affect other workloads or systems, depending on its privileges and environment.

General mitigation guidance

Defensive patterns include replacing nested pickle data with a non-executable, schema-constrained format and rejecting unexpected checkpoint structures. Treat model paths and checkpoint contents as untrusted unless their provenance and integrity are established; avoid accepting arbitrary checkpoints from users or external sources. Apply strict validation before processing, and run NLP workloads with least privilege and limited access to secrets, files, and network resources.

How teams detect issues like this

  • Use static analysis to identify pickle.loads and similar deserialization calls, especially when their input comes from decompression or model/checkpoint fields.
  • Review checkpoint-loading code for nested serialized content that is not covered by the outer loader's safety controls.
  • Check whether user-controlled paths or uploaded model artifacts can reach pipeline construction.
  • Apply code-review and CI policies that prohibit unrestricted pickle deserialization of untrusted data; automated review tools can help flag these patterns.

Sources

SourceLink
github.comgithub.com/stanfordnlp/stanza/commit/b21e1c9b47b4fccff21d3b0a6c0687a19410c2f0
github.comgithub.com/stanfordnlp/stanza/pull/1649
github.comgithub.com/stanfordnlp/stanza/releases/tag/v1.15.0
github.comgithub.com/stanfordnlp/stanza/security/advisories/GHSA-gh9r-c94j-cmp5

Frequently asked

questions

Not inherently. Remote exploitation depends on whether an application allows an attacker to supply or influence the checkpoint loaded by Stanza.

They need a way to make the application load an attacker-controlled lemmatizer checkpoint, such as through a caller-influenced model path or an exposed checkpoint-upload workflow.

Avoid unrestricted pickle deserialization for checkpoint data. Prefer a non-executable format with strict schema and content validation.

Treat model artifacts and paths as untrusted, verify their provenance and integrity, inspect nested serialization paths, and limit the runtime privileges of workloads that load them.

Find out what's already
exploitable in your codebase.