CVE-2026-61536
Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE
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.
INFO
Published Date :
July 30, 2026, 7:18 p.m.
Last Modified :
Oct. 23, 2026, 10:10 p.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | HIGH | [email protected] | ||||
| CVSS 3.1 | HIGH | MITRE-CVE |
Solution
- Update Banks to version 2.4.3 or later.
- Review tool import paths for sanitization.
- Implement an allowlist for tool imports.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-61536.
| URL | Resource |
|---|---|
| https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7 | |
| https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7 |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-61536 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-61536
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-61536 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-61536 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Oct. 23, 2026
Action Type Old Value New Value Added Translation Title: banks de masci, Description: Banks genera prompts de LLM significativos utilizando un lenguaje de plantillas simple. En versiones anteriores a la 2.4.3, banks analiza objetos JSON de Tool del cuerpo renderizado de los bloques {% completion %} y posteriormente resuelve su campo import_path a través de importlib.import_module(...) + getattr(...) para obtener el invocable que maneja una llamada a herramienta. No hay una lista de permitidos (allowlist) ni sanitización en import_path, por lo que cualquier atributo Python importable (por ejemplo, os.system, subprocess.getoutput) puede ser seleccionado. Cuando el LLM emite una entrada tool_calls cuyo function.name coincide con el nombre de la herramienta proporcionado por el atacante, el invocable resuelto es invocado con kwargs decodificados de tool_call.function.arguments, produciendo ejecución de código arbitrario en el proceso que aloja banks. Esto es distinto de GHSA-gphh-9q3h-jgpp / CVE-2026-44209. Esa advertencia se corrigió en la 2.4.2 cambiando src/banks/env.py de Environment a SandboxedEnvironment. La corrección no afecta a src/banks/extensions/completion.py, y la cadena insegura de import + getattr todavía se ejecuta en la 2.4.2. El JSON de Tool malicioso es texto plano en el cuerpo de la plantilla renderizada - no requiere acceso a atributos de Jinja, por lo que el sandbox es irrelevante. Este problema ha sido corregido en la versión 2.4.3. -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jul. 31, 2026
Action Type Old Value New Value Added Reference https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7 Added SSVC {'id': 'CVE-2026-61536', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'poc'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-07-31T23:00:33.742984Z'} -
New CVE Received by [email protected]
Jul. 30, 2026
Action Type Old Value New Value Added Affected [{'vendor': 'masci', 'product': 'banks', 'versions': [{'status': 'affected', 'version': '< 2.4.3'}]}] 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. Added CVSS V3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H Added CWE CWE-94 Added CWE CWE-470 Added Reference https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7