Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessInject malicious Tool JSON into completion block
-
DeliverySet import_path to os.system/subprocess.getoutput
-
ExploitLLM emits matching tool_calls entry
-
ExecutionBanks resolves callable via importlib+getattr
-
PersistInvoke with attacker-decoded kwargs
-
ImpactArbitrary code execution in host process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the attacker to control the import_path field of a Tool JSON object appearing in the rendered body of a {% completion %} block, and for the application to be using Banks' completion/tool-calling extension so that LLM tool_calls are resolved and invoked. Concretely, the payload is plain text in the rendered template output - so it requires no Jinja attribute access and the SandboxedEnvironment introduced in 2.4.2 does not mitigate it - but the callable only fires when the LLM emits a tool_calls entry whose function.name matches the attacker-supplied tool name, meaning execution is gated on the model's tool-selection behavior (AC:H). Limiting factors: the attacker needs write influence over template/tool content (PR:L rather than fully unauthenticated), the deployment must actually process tool calls, and versions 2.4.3 and later are not affected. |
| Impact | The provided CVSS 3.1 vector (AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H, base 7.5) reflects full confidentiality/integrity/availability impact (arbitrary code execution) tempered by high attack complexity and low-but-nonzero privileges - the attacker must be able to place a malicious Tool definition into the rendered template body AND rely on the LLM to emit a tool_calls entry whose function.name matches, a condition partly outside the attacker's direct control. No EPSS score, KEV listing, or SSVC decision data was supplied, and no POC is referenced, so exploitation probability cannot be quantified from the inputs; the honest read is 'no public exploit identified at time of analysis.' This is a genuine RCE and should be prioritized wherever Banks renders any untrusted or semi-trusted content into completion blocks, but the AC:H/PR:L profile and the dependency on the LLM tool-call loop make it more of a targeted, integration-specific risk than a mass-exploitable internet-facing flaw. The main uncertainty: real-world exposure depends heavily on whether an application lets untrusted input reach template/tool definitions - verify per deployment. |
| Exploit ScenarioDerived | An attacker who can influence the content rendered into a completion block (for example via untrusted data that reaches the prompt template or tool definitions) inserts a Tool JSON object with import_path set to something like 'os.system' or 'subprocess.getoutput'. When the LLM subsequently returns a tool_calls entry whose function.name matches that tool, Banks resolves and invokes the attacker-chosen callable with attacker-decoded kwargs, achieving arbitrary command execution inside the application process. No public POC is referenced, and the high attack complexity reflects the need to influence tool definitions and win the LLM's tool-call selection. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 30, 2026
Arbitrary code execution in the Banks Python LLM-templating library (versions prior to 2.4.3) allows an attacker who can influence Tool JSON definitions within a {% completion %} block to run any importable Python callable in the host process. Banks resolves the attacker-controlled import_path field via importlib.import_module() plus getattr() with no allowlist, so values like os.system or subprocess.getoutput become invokable when the LLM emits a matching tool_calls entry, passing decoded arguments as kwargs. No public exploit identified at time of analysis; this bug is explicitly distinct from and unfixed by the 2.4.2 SandboxedEnvironment patch (GHSA-gphh-9q3h-jgpp / CVE-2026-44209) because the malicious payload is plain text in the rendered body and never touches Jinja attribute access.
RemediationAI
Upgrade Banks to version 2.4.3, which contains the fix for this issue (Vendor-released patch: 2.4.3); do not rely on 2.4.2, which patched the unrelated sandbox CVE-2026-44209 but left the unsafe import_path resolution in completion.py intact. See the advisory at https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7. If immediate upgrade is not possible, apply compensating controls: treat all template and Tool JSON content as trusted-only and never render untrusted user/LLM-supplied data into {% completion %} blocks; if you maintain a fork or wrapper, enforce an allowlist restricting import_path to a small set of vetted, fully-qualified callables and reject any path resolving into os, subprocess, builtins, or similar process/eval modules (trade-off: legitimate dynamic tools must be pre-registered); and run the Banks-hosting process under a least-privilege, sandboxed account or container so that a successful callable invocation has minimal blast radius. These controls constrain but do not fully eliminate the flaw - the patched release remains the durable fix.
Affected VersionsENISA
Affected Packages
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 LLM prompts using a Jinja-based template language, with a {% completion %} extension (src/banks/extensions/completion.py) that supports tool/function calling. The root cause is CWE-94 (Code Injection): after rendering, Banks parses Tool JSON objects from the completion block body and treats the JSON's import_path string as a fully-qualified Python attribute path, resolving it with importlib.import_module(module) followed by getattr(module, attr) to obtain the tool handler. Because there is no allowlist, deny-list, or namespace restriction on import_path, any importable attribute in the running interpreter - standard-library process-execution primitives included - can be selected as the 'tool' callable. The single affected package is identified by CPE cpe:2.3:a:masci:banks (the 'banks' project by author masci). Critically, the earlier 2.4.2 fix only swapped src/banks/env.py from Environment to SandboxedEnvironment to constrain Jinja sandbox escapes; it did not modify completion.py, and since the Tool JSON is literal text in the rendered output rather than a Jinja expression, the sandbox provides no protection against this vector.
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
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Network-reachable but gated on attacker-influenced tool definitions (PR:L) and the LLM emitting a matching tool_call (AC:H); arbitrary code execution yields full C:H/I:H/A:H.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Banks generates meaningful LLM prompts using a simple template language. In versions prior to 2.4.3, banks parses Tool JSON objects from the rendered body of {% completion %} blocks and later resolves their import_path field through importlib.import_module(...) + getattr(...) to obtain the callable that handles a tool call. There is no allowlist or sanitization on import_path, so any importable Python attribute (e.g. os.system, subprocess.getoutput) can be selected. When the LLM emits a tool_calls entry whose function.name matches the attacker-supplied tool name, the resolved callable is invoked with kwargs decoded from tool_call.function.arguments, yielding arbitrary code execution in the banks-hosting process. This is distinct from GHSA-gphh-9q3h-jgpp / CVE-2026-44209. That advisory was fixed in 2.4.2 by switching src/banks/env.py from Environment to SandboxedEnvironment. The fix does not touch src/banks/extensions/completion.py, and the unsafe import + getattr chain still executes on 2.4.2. The malicious Tool JSON is plain text in the rendered template body - it requires no Jinja attribute access, so the sandbox is irrelevant. This issue has been fixed in version 2.4.3.
Articles & Coverage 1
Executive ViewAI
Banks Python LLM-templating library (versions prior to 2.4.3) contains an arbitrary code execution vulnerability that allows attackers controlling tool JSON definitions to execute arbitrary Python code with full application privileges. Any organization using Banks-based LLM applications where tool schemas accept untrusted input faces direct risk of full application compromise and data breach.
No vendor-released patch identified at time of analysis. Restrict tool JSON schema creation to authenticated trusted administrators; implement allowlist-based validation blocking system-level callables (os.system, subprocess.getoutput, etc.); deploy in containerized environments with minimal privileges and read-only filesystems; implement audit logging on all tool_calls entries to detect suspicious import paths; if tool schemas are user-defined or auto-generated, disable dynamic tool definition until patch availability.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Path traversal in the Banks Python prompt-template library (all versions prior to 2.4.5) allows a low-privileged attacke
Arbitrary file disclosure in the Banks Python prompt-templating library (masci/banks) before 2.4.4 lets attackers who co
Banks, a Python library for generating LLM prompts from a simple template language, ships a DirectoryPromptRegistry that
Prompt-structure injection in the Banks LLM prompt-templating library (masci/banks) before 2.5.0 allows attacker-control
EUVD-2026-51246
GHSA-64vx-6h2c-rjh7
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB