Skip to main content

Banks EUVDEUVD-2026-95341

| CVE-2026-107717 MEDIUM
Improper Input Validation (CWE-20)
2026-10-08 GitHub_M GHSA-hmq2-7hp6-7crh
6.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Submit crafted ChatMessage JSON in user input
  2. Exploit
    Banks template renders untrusted line
  3. Execution
    Line parsed into ChatMessage with arbitrary role
  4. Impact
    Injected system/tool message overrides prompt instructions

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires that the consuming application (1) renders attacker-controlled/untrusted data through a Banks template, (2) calls Prompt.chat_messages() on that rendered output, and (3) forwards the returned ChatMessage objects to an LLM provider. The decisive weakness is that chat_messages() parses every rendered line as ChatMessage JSON and ChatMessage.role accepts arbitrary string values, so an injected line can become a system, assistant, or tool message. LIMITING FACTORS: this is not exploitable against a default Banks install in isolation - it only manifests when untrusted input is deliberately templated into the chat-message pipeline; applications that template only trusted data, or that do not use chat_messages()/the chat extension, are not affected. Fixed in 2.5.0 via an environment sentinel so only intended chat blocks produce parseable messages.

Impact

This is a medium-severity (CVSS 6.5) input-validation flaw (CWE-20) in the Banks LLM prompt-templating library, and the signals point to a genuine-but-not-urgent issue rather than a fire. The CVSS vector (AV:N/AC:L/PR:N/UI:N) describes low-complexity, unauthenticated, remote reachability, but the impact is deliberately limited to C:L/I:L/A:N - reflecting prompt-structure manipulation (injecting system/assistant/tool messages), not code execution or data destruction. No EPSS score was provided in the input, so exploitation probability cannot be quantified here; this should be verified against the FIRST EPSS feed. There is no CISA KEV listing and no public exploit referenced, so exploitation status is: no public exploit identified at time of analysis. No SSVC decision record was supplied. The key tension is between the 'easy remote' CVSS metrics and the real precondition: the flaw only matters when an application deliberately renders attacker-controlled data through a Banks template and forwards the resulting ChatMessage objects to an LLM - this is an application-design-dependent path, not a default-on remote service, which materially lowers real-world risk below what the raw 6.5 implies for most deployments. Prioritize patching for applications that template untrusted user input into LLM prompts; deprioritize where templates only consume trusted data.

Exploit ScenarioDerived

An application uses Banks to build LLM prompts and interpolates untrusted user input (e.g., a chat message or document) into a template. The attacker submits input containing a crafted line of ChatMessage JSON with role 'system' or 'tool'; because Prompt.chat_messages() parses every rendered line as ChatMessage JSON and ChatMessage.role accepts arbitrary strings, the injected object crosses the prompt boundary and is delivered to the LLM as a privileged message, overriding the application's instructions. No public proof-of-concept is referenced in the provided data.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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 – Oct 08, 2026

Prompt-structure injection in the Banks LLM prompt-templating library (masci/banks) before 2.5.0 allows attacker-controlled template data to cross the prompt boundary and be reinterpreted as system, assistant, or tool chat messages. Because Prompt.chat_messages() parses every rendered line of template output as ChatMessage JSON and ChatMessage.role accepts arbitrary strings, an unauthenticated remote attacker who can induce a consuming application to render untrusted data through a Banks template and forward the resulting messages to an LLM provider can override system instructions, alter the intended prompt structure, or confuse downstream tool and message handling. This is a genuine but conditional, medium-severity input-validation flaw (CVSS 6.5, CWE-20): it does not affect a default Banks install in isolation, and no public exploit code was identified at time of analysis. Vendor-released patch: 2.5.0.

RemediationAI

Primary fix: upgrade Banks to 2.5.0 or later, which is the vendor-released patch that adds an environment sentinel so only intended chat blocks yield parseable ChatMessage objects (see https://github.com/masci/banks/releases/tag/v2.5.0 and the advisory https://github.com/masci/banks/security/advisories/GHSA-hmq2-7hp6-7crh). For applications that cannot upgrade immediately, the effective compensating control is to stop feeding untrusted input into the chat-message pipeline: do not interpolate user-supplied or external data into templates whose rendered output is passed to Prompt.chat_messages() (or to the chat extension), and instead pass such data through non-chat variables or pre-validate/sanitize values so that no rendered line can be valid ChatMessage JSON. Alternatively, avoid calling chat_messages() on templates that mix trusted and untrusted content, and enforce an allowlist of expected roles (system/user/assistant/tool) on the consuming side before forwarding messages to the LLM provider; the trade-off is that this shifts validation into every consuming application and will break legitimate dynamic-role use cases unless mappings are maintained. Note that fixing the underlying issues only partially helps if the application itself still legitimizes attacker-influenced role values, so pairing the upgrade with an application-level check of ChatMessage.role is recommended.

Affected VersionsENISA

banks < 2.5.0

Affected Packages

pypi banks fix: 2.5.0

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 generates LLM prompts using a Jinja-based template language, and its chat extension converts rendered template blocks into structured ChatMessage objects (with ContentBlock content plus role, name, and tool_call_id fields) that are handed directly to LLM providers. The root cause is improper input validation (CWE-20): prior to 2.5.0, chat_messages() attempted to JSON-parse every line of rendered output as a ChatMessage, and ChatMessage.role was not constrained to a fixed allowlist of roles, so any attacker-supplied line that happened to be valid ChatMessage JSON was accepted as a genuine message with an attacker-chosen role. The upstream fix (PR #78, commit 02172b816fb84f6a824cc09a8aca7416f53c12cb) introduces an environment sentinel via ensure_environment_sentinel() and sentinel_from_context(): the chat extension now receives the render context (nodes.ContextReference()) when storing chat messages, and only messages produced by intended chat blocks carrying that sentinel are parsed, while lines rendered straight off the environment inherit a fallback sentinel. The CPE cpe:2.3:a:masci:banks:*:*:*:*:*:*:*:* covers all released versions before 2.5.0. The CVSS vector AV:N/AC:L/PR:N/UI:N confirms the injection is reachable remotely without authentication or user interaction at the library level, with limited confidentiality and integrity impact (C:L/I:L) and no availability impact - consistent with prompt-boundary tampering rather than direct code execution.

Know when Banks 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 (GitHub_M) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
vuln.today AI 6.5 MEDIUM

Untrusted data crosses the prompt boundary remotely without authentication or interaction; primary impact is integrity of prompt structure (I:L) with limited confidentiality leakage potential (C:L) and no availability impact.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

1
Patch available
Oct 08, 2026 - 23:02 EUVD

DescriptionCVE.org

Banks generates meaningful LLM prompts using a simple template language. Prior to 2.5.0, Banks Prompt.chat_messages() attempts to parse every line of rendered template output as ChatMessage JSON. When an application renders untrusted data and passes the returned ChatMessage objects to an LLM provider, attacker-controlled JSON can cross the prompt boundary and become a system, assistant, or tool message because ChatMessage.role accepts arbitrary strings. This can override application instructions, alter the intended prompt structure, or confuse downstream tool and message handling. This issue is fixed in version 2.5.0.

Threat Intelligence Overview

EPSS Score
0.3%
Top 81% exploitable
Prevalence
Low
niche open-source Python LLM prompt library, limited production footprint
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Yes
Human Impact· derived
Medium

Priority Score

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

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

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