CVE-2025-25362: spacy-llm: SSTI allows unauthenticated RCE (CVSS 9.8)

GHSA-793v-gxfp-9q9h CRITICAL PoC AVAILABLE CISA: ATTEND
Published March 5, 2025
CISO Take

Any application using spacy-llm <= 0.7.2 that accepts external input to its template field is fully compromised — no authentication required. Upgrade to 0.7.3 immediately; this is a drop-in patch with no breaking changes. Audit every service in your AI/NLP stack that uses spacy-llm and assume breach if template fields were exposed to untrusted input.

Risk Assessment

CVSS 9.8 with AV:N/AC:L/PR:N/UI:N represents worst-case exploitability — no authentication, no user interaction, low complexity, full CIA impact. EPSS of 0.00453 reflects low observed exploitation at time of scoring, but a detailed public PoC blog was published on April 1, 2025, substantially lowering the bar for exploitation. AI/ML workloads typically run with broad filesystem and network access, making post-exploitation impact significantly higher than a standard application RCE.

Affected Systems

Package Ecosystem Vulnerable Range Patched
spacy-llm pip <= 0.7.2 0.7.3
33.5K OpenSSF 5.4 154 dependents Pushed 1mo ago 100% patched ~14d to patch Full package profile →

Do you use spacy-llm? You're affected.

Severity & Risk

CVSS 3.1
9.8 / 10
EPSS
0.0%
chance of exploitation in 30 days
Higher than 15% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I High
A High

Recommended Action

5 steps
  1. PATCH

    Upgrade spacy-llm to 0.7.3 — the fix is available in the referenced commit (8bde049). No API changes required.

  2. WORKAROUND (if patching is blocked): Treat the template field as untrusted input — strip or reject any Jinja2/template syntax characters ({%, {{, }}) before passing data to spacy-llm.

  3. AUDIT

    Search codebases for uses of spacy-llm's template parameter accepting request body data, file contents, or any externally-sourced strings.

  4. DETECT

    Monitor for anomalous process spawning from Python interpreters running spaCy — unexpected subprocesses, outbound connections from ML worker nodes, or unusual file access patterns.

  5. CONTAIN

    If exposure is confirmed, rotate all credentials accessible to the compromised process (LLM API keys, DB credentials, cloud IAM tokens).

CISA SSVC Assessment

Decision Attend
Exploitation poc
Automatable Yes
Technical Impact total

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, Robustness and Cybersecurity
ISO 42001
A.6.2.6 - AI System Security Controls — Dependency Management
NIST AI RMF
GOVERN 6.1 - Policies for Third-Party AI Risks
OWASP LLM Top 10
LLM03:2025 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2025-25362?

Any application using spacy-llm <= 0.7.2 that accepts external input to its template field is fully compromised — no authentication required. Upgrade to 0.7.3 immediately; this is a drop-in patch with no breaking changes. Audit every service in your AI/NLP stack that uses spacy-llm and assume breach if template fields were exposed to untrusted input.

Is CVE-2025-25362 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2025-25362, increasing the risk of exploitation.

How to fix CVE-2025-25362?

1. PATCH: Upgrade spacy-llm to 0.7.3 — the fix is available in the referenced commit (8bde049). No API changes required. 2. WORKAROUND (if patching is blocked): Treat the template field as untrusted input — strip or reject any Jinja2/template syntax characters ({%, {{, }}) before passing data to spacy-llm. 3. AUDIT: Search codebases for uses of spacy-llm's template parameter accepting request body data, file contents, or any externally-sourced strings. 4. DETECT: Monitor for anomalous process spawning from Python interpreters running spaCy — unexpected subprocesses, outbound connections from ML worker nodes, or unusual file access patterns. 5. CONTAIN: If exposure is confirmed, rotate all credentials accessible to the compromised process (LLM API keys, DB credentials, cloud IAM tokens).

What systems are affected by CVE-2025-25362?

This vulnerability affects the following AI/ML architecture patterns: NLP preprocessing pipelines, RAG ingestion pipelines, document processing APIs, LLM integration frameworks, agent frameworks with NLP components.

What is the CVSS score for CVE-2025-25362?

CVE-2025-25362 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.05%.

Technical Details

NVD Description

A Server-Side Template Injection (SSTI) vulnerability in Spacy-LLM v0.7.2 allows attackers to execute arbitrary code via injecting a crafted payload into the template field.

Exploitation Scenario

An adversary targeting an organization running a document analysis API backed by spacy-llm submits a crafted document or API request with a payload such as {{ ''.__class__.__mro__[1].__subclasses__()[X].__init__.__globals__['os'].popen('id').read() }} injected into a field that is forwarded to spacy-llm's template processor. The template engine evaluates the payload server-side, executing arbitrary OS commands under the Python process identity. The attacker pivots to exfiltrate LLM API keys stored in environment variables, dumps model artifacts from disk, and establishes a reverse shell into the ML infrastructure — all without any valid credentials.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
March 5, 2025
Last Modified
April 2, 2025
First Seen
March 24, 2026

Related Vulnerabilities