Skip to main content

Banks EUVDEUVD-2026-51246

| CVE-2026-61536 HIGH
Code Injection (CWE-94)
2026-07-30 GitHub_M GHSA-64vx-6h2c-rjh7
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Inject malicious Tool JSON into completion block
  2. Delivery
    Set import_path to os.system/subprocess.getoutput
  3. Exploit
    LLM emits matching tool_calls entry
  4. Execution
    Banks resolves callable via importlib+getattr
  5. Persist
    Invoke with attacker-decoded kwargs
  6. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.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 – 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

banks < 2.4.3

Affected Packages

pypi banks fix: 2.4.3

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

Vendor (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.5 HIGH

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.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
Jul 30, 2026 - 18:03 EUVD
CVE Published
Jul 30, 2026 - 16:50 cve.org
HIGH 7.5

DescriptionCVE.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.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.3%
Top 78% exploitable
Prevalence
Low
niche Python LLM-templating library, small open-source footprint
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

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 Yes
EPSS 0.3%
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
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

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

Attack Technique

Code Injection CRITICAL

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.

Vendor StatusVendor

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