Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. banks
  4. ›
  5. CVE-2026-61536

CVE-2026-61536: Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE

November 5, 2026

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.

References

  • github.com/advisories/GHSA-64vx-6h2c-rjh7
  • github.com/masci/banks/commit/e443f112b80a20ac24438afe4eb8f8a746a8396d
  • github.com/masci/banks/pull/75
  • github.com/masci/banks/releases/tag/v2.4.3
  • github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7
  • nvd.nist.gov/vuln/detail/CVE-2026-61536

Code Behaviors & Features

Detect and mitigate CVE-2026-61536 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 2.4.3

Fixed versions

  • 2.4.3

Solution

Upgrade to version 2.4.3 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/banks/CVE-2026-61536.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 06 Nov 2026 12:16:54 +0000.