CVE-2025-25362: spacy-llm: SSTI allows unauthenticated RCE (CVSS 9.8)
GHSA-793v-gxfp-9q9h CRITICAL PoC AVAILABLE CISA: ATTENDAny 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 |
Do you use spacy-llm? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
PATCH
Upgrade spacy-llm to 0.7.3 — the fix is available in the referenced commit (8bde049). No API changes required.
-
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.
-
AUDIT
Search codebases for uses of spacy-llm's template parameter accepting request body data, file contents, or any externally-sourced strings.
-
DETECT
Monitor for anomalous process spawning from Python interpreters running spaCy — unexpected subprocesses, outbound connections from ML worker nodes, or unusual file access patterns.
-
CONTAIN
If exposure is confirmed, rotate all credentials accessible to the compromised process (LLM API keys, DB credentials, cloud IAM tokens).
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
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.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
- github.com/advisories/GHSA-793v-gxfp-9q9h
- github.com/explosion/spacy-llm/commit/8bde0490cc1e9de9dd2e84480b7b5cd18a94d739
- github.com/explosion/spacy-llm/issues/492
- github.com/explosion/spacy-llm/pull/491
- nvd.nist.gov/vuln/detail/CVE-2025-25362
- hacktivesecurity.com/blog/2025/04/01/cve-2025-25362-old-vulnerabilities-new-victims-breaking-llm-prompts-with-ssti
- github.com/fkie-cad/nvd-json-data-feeds Exploit
Timeline
Related Vulnerabilities
CVE-2026-44209 7.5 banks: SSTI enables RCE via unsandboxed Jinja2 templates
Same package: spacy CVE-2025-5120 10.0 smolagents: sandbox escape enables unauthenticated RCE
Same attack type: Code Execution CVE-2025-2828 10.0 LangChain RequestsToolkit: SSRF exposes cloud metadata
Same attack type: Data Extraction CVE-2025-53767 10.0 Azure OpenAI: SSRF EoP, no auth required (CVSS 10)
Same attack type: Data Extraction CVE-2023-3765 10.0 MLflow: path traversal allows arbitrary file read
Same attack type: Data Extraction
AI Threat Alert