Description
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.
Published: 2026-07-30
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Banks allows an attacker to manipulate the import_path field of a tool specification inside a completion block to import and execute any importable Python attribute, such as os.system or subprocess.getoutput. The system performs importlib.import_module followed by getattr without any allowlist, causing arbitrary code to run in the banks-hosting process. The CVSS score of 7.5 reflects the ability to achieve complete process compromise whenever a malicious LLM prompt triggers the vulnerable tool call. This weakness is a classic instance of CWE‑470 (Use of Hard-Coded Resource or Logic) and CWE‑94 (Improper Handling of Code Injection).

Affected Systems

The affected product is masci:banks. Any instance running a version prior to 2.4.3 is vulnerable. The bug was resolved in banks 2.4.3 and later releases; versions 2.4.2 and earlier remain at risk. No other affected vendors or product lines are listed.

Risk and Exploitability

The vulnerability has a high severity but the EPSS score is <1%; KEV lists it as not exploited yet. Attackers can exploit it primarily by submitting a crafted prompt that includes a malicious tool call; no additional access or privilege is required beyond permission to invoke the LLM. Once triggered, the bug gives full control over the host process. Continued exploitation risk is significant for systems that accept untrusted prompts or lack a sandboxed execution environment. The lack of an allowlist or sanitization makes the RCE straightforward when the LLM emits a matching tool call.

Generated by OpenCVE AI on August 2, 2026 at 05:06 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade banks to version 2.4.3 or later, which removes the unsafe import chain
  • If upgrading is not immediately feasible, modify all completion templates to eliminate or delete Tool JSON blocks that allow attacker-controlled function calls, thereby preventing the vulnerable import process from being exercised
  • Implement a runtime policy or patch that replaces the default importlib import and getattr with a sandboxed or allowlisted alternative, ensuring only approved modules and attributes can be invoked

Generated by OpenCVE AI on August 2, 2026 at 05:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 31 Jul 2026 23:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 30 Jul 2026 18:45:00 +0000

Type Values Removed Values Added
First Time appeared Masci
Masci banks
Vendors & Products Masci
Masci banks

Thu, 30 Jul 2026 17:30:00 +0000

Type Values Removed Values Added
Description 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.
Title Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE
Weaknesses CWE-470
CWE-94
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-31T23:01:03.395Z

Reserved: 2026-07-10T16:27:03.093Z

Link: CVE-2026-61536

cve-icon Vulnrichment

Updated: 2026-07-31T23:00:59.036Z

cve-icon NVD

Status : Deferred

Published: 2026-07-30T19:18:34.553

Modified: 2026-07-31T23:17:25.930

Link: CVE-2026-61536

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-02T05:15:15Z

Weaknesses
  • CWE-470

    Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')