CVE-2026-61536: Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE
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 importpath field through importlib.importmodule(...) + getattr(...) to obtain the callable that handles a tool call. There is no allowlist or sanitization on importpath, so any importable Python attribute (e.g. os.system, subprocess.getoutput) can be selected. When the LLM emits a toolcalls entry whose function.name matches the attacker-supplied tool name, the resolved callable is invoked with kwargs decoded from toolcall.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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
banksto a version that resolves this vulnerability.Fixed in 2.4.3
Event History
Frequently Asked Questions
What is the severity of CVE-2026-61536?
CVE-2026-61536 has a severity rating of high, scored at 7.5 on the CVSS scale.
How does CVE-2026-61536 allow for remote code execution?
CVE-2026-61536 allows remote code execution because it uses unsafe importlib.import_module to load attacker-controlled Tool.import_path.
Which versions of the software are affected by CVE-2026-61536?
CVE-2026-61536 affects versions of banks prior to 2.4.3.
How do I fix CVE-2026-61536?
To fix CVE-2026-61536, update your banks installation to version 2.4.3 or later.
What type of vulnerability is CVE-2026-61536 classified as?
CVE-2026-61536 is classified as a code injection vulnerability.