CVE-2026-61536 Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE
- Published
- Updated
- Exploit status
- No public exploit known
- Technology
- Red Hat
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.
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi banks(PyPI) | < 2.4.3 | 2.4.3 |
| pypi banks(PyPI) | = 0.0.1 | No fix listed |
| pypi banks(PyPI) | = 0.0.2 | No fix listed |
| pypi banks(PyPI) | = 0.0.3 | No fix listed |
| pypi banks(PyPI) | = 0.1.0 | No fix listed |
| pypi banks(PyPI) | = 0.1.1 | No fix listed |
| pypi banks(PyPI) | = 0.2.0 | No fix listed |
| pypi banks(PyPI) | = 0.3.0 | No fix listed |
| pypi banks(PyPI) | = 0.3.1 | No fix listed |
| pypi banks(PyPI) | = 0.4.1 | No fix listed |
| pypi banks(PyPI) | = 0.5.0 | No fix listed |
| pypi banks(PyPI) | = 0.6.0 | No fix listed |
| pypi banks(PyPI) | = 1.0.0 | No fix listed |
| pypi banks(PyPI) | = 1.1.0 | No fix listed |
| pypi banks(PyPI) | = 1.2.0 | No fix listed |
| pypi banks(PyPI) | = 1.2.1 | No fix listed |
| pypi banks(PyPI) | = 1.3.0 | No fix listed |
| pypi banks(PyPI) | = 1.4.0 | No fix listed |
| pypi banks(PyPI) | = 1.5.0 | No fix listed |
| pypi banks(PyPI) | = 1.6.0 | No fix listed |
| pypi banks(PyPI) | = 1.6.1 | No fix listed |
| pypi banks(PyPI) | = 1.7.0 | No fix listed |
| pypi banks(PyPI) | = 1.7.1 | No fix listed |
| pypi banks(PyPI) | = 1.8.0 | No fix listed |
| pypi banks(PyPI) | = 2.0.0 | No fix listed |
Show 16 more
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi banks(PyPI) | = 2.1.0 | No fix listed |
| pypi banks(PyPI) | = 2.1.1 | No fix listed |
| pypi banks(PyPI) | = 2.1.2 | No fix listed |
| pypi banks(PyPI) | = 2.1.3 | No fix listed |
| pypi banks(PyPI) | = 2.2.0 | No fix listed |
| pypi banks(PyPI) | = 2.3.0 | No fix listed |
| pypi banks(PyPI) | = 2.4.0 | No fix listed |
| pypi banks(PyPI) | = 2.4.1 | No fix listed |
| pypi banks(PyPI) | = 2.4.2 | No fix listed |
| masci banks | = < 2.4.3 | No fix listed |
| redhat/exploit-intelligence-tech-preview/vulnerability-analysis-rhel9(Red Hat:exploit_intelligence:0) | All versions | No fix listed |
| redhat/lightspeed-core/rag-tool-cpu-rhel9(Red Hat:lightspeed_core) | All versions | No fix listed |
| redhat/lightspeed-core/rag-tool-cuda-12.9-rhel9(Red Hat:lightspeed_core) | All versions | No fix listed |
| redhat/openshift-lightspeed/lightspeed-service-api-rhel9(Red Hat:openshift_lightspeed:1) | All versions | No fix listed |
| redhat/ansible-automation-platform-25/lightspeed-chatbot-rhel8(Red Hat:ansible_automation_platform:2) | All versions | No fix listed |
| pypi banks(PyPI) | <= 2.4.2 | No fix listed |
References
- https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7 exploit vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com patch
- github.com patch
- github.com product
- github.com
- Red Hat CVE page mitigation vendor-advisory
- Red Hat Bugzilla 2509550 issue-tracking
- www.cve.org
- github.com