Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 4 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| masci | banks | before 2.4.3 | 2.4.3 | Patch available | CNA |
| — | banks (PyPI) | before 2.4.3 | 2.4.3 | Patch available | GHSA-64vx-6h2c-rjh7 |
- banks Vendormasci Affected before 2.4.3 Fixed in 2.4.3 Patch available CNA
- banks (PyPI) Vendor— Affected before 2.4.3 Fixed in 2.4.3 Patch available GHSA-64vx-6h2c-rjh7
Remediation
- Fix · CNA banks (masci) Fixed in 2.4.3
- Fix · GHSA-64vx-6h2c-rjh7 banks (PyPI) Fixed in 2.4.3 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Exploit Intelligence | Affected | No fix yet |
| Lightspeed Core | Affected | No fix yet |
| OpenShift Lightspeed | Affected | No fix yet |
| Red Hat Ansible Automation Platform 2 | Affected | No fix planned: Will not fix |
Not affected: 1 product
- OpenShift Lightspeed
Timeline
- 2026-10-02 Threatist record created from CVE-2026-61536
- 2026-11-05 Alias added: GHSA-64vx-6h2c-rjh7
- 2026-11-05 Fix available: PyPI/[email protected] · GHSA-64vx-6h2c-rjh7
- 2026-11-05 CVSS score added · GHSA-64vx-6h2c-rjh7
- 2026-11-05 Weakness changed · GHSA-64vx-6h2c-rjh7
- 2026-11-05 6 new references · GHSA-64vx-6h2c-rjh7
References
More masci vulnerabilities
- TI-2026-44773 Banks: Arbitrary File Read via Path Traversal in Media Filters (image/audio/video/document) CVSS 3.1HIGH 7.5
- TI-2026-69696 Banks parses untrusted prompt input as privileged chat messages CVSS 3.1MEDIUM 6.5
- TI-2026-32188 Banks: Critical Remote Code Execution (RCE) via Jinja2 SSTI CVSS 3.1HIGH 7.5
- TI-2026-50100 Banks: Path traversal in `DirectoryPromptRegistry.set()` allows arbitrary file write outside the registry root CVSS 4.0MEDIUM 6.0
- TI-2026-69682 Symlink traversal in Banks DirectoryPromptRegistry CVSS 4.0HIGH 7.3
Sources
- CVE-2026-61536 · CVE Program
- CVE-2026-61536 · NVD
- FIRST EPSS
- GHSA-64vx-6h2c-rjh7 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-61536 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences