{"id":"CVE-2026-61536","published":"2026-07-30T16:50:01Z","modified":"2026-07-31T23:01:03Z","title":"Banks: Unsafe importlib.import_module of attacker-controlled Tool.import_path in CompletionExtension allows RCE","vendor":"masci","product":"banks","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00377,"percentile":0.32544,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-470","name":"Use of Externally-Controlled Input to Select Classes or Code"}],"references":[{"url":"https://github.com/masci/banks/security/advisories/GHSA-64vx-6h2c-rjh7","tags":["x_refsource_CONFIRM"]}],"priority":{"score":11.8,"factors":[{"name":"EPSS percentile","points":6.51},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"masci","affectedVersions":[{"vendor":"masci","product":"banks","versions":["< 2.4.3"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-07-31T23:00:33.742984Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"banks","vulnerableRanges":["<2.4.3"],"patched":["2.4.3"],"from":["GHSA-64vx-6h2c-rjh7"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-51246","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-masci-banks-cve-2026-61536","children":[{"from":"CVE-2026-61536","to":"CVE-2026-107717","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/banks/extensions/completion.py","src/banks/filters/tool.py"],"commits":["https://github.com/masci/banks/commit/02172b816fb84f6a824cc09a8aca7416f53c12cb","https://github.com/masci/banks/commit/e443f112b80a20ac24438afe4eb8f8a746a8396d"],"basis":"shared function","functions":["CompletionExtension","_do_completion","_do_completion_async","_get_tool_callable","tool"]}]}],"packageHistory":[{"cve":"CVE-2026-44209","published":"2026-05-26","fixed":"2.4.2","kev":false,"link":{"from":"CVE-2026-44209","to":"CVE-2026-61536","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:banks","fromFixed":"2.4.2","toFixed":"2.4.3","daysApart":65}]}},{"cve":"CVE-2026-61536","published":"2026-07-30","fixed":"2.4.3","kev":false},{"cve":"CVE-2026-71492","published":"2026-08-20","fixed":"2.4.5","kev":false,"link":{"from":"CVE-2026-61536","to":"CVE-2026-71492","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:banks","fromFixed":"2.4.3","toFixed":"2.4.5","daysApart":21}]}},{"cve":"CVE-2026-107717","published":"2026-10-08","fixed":"2.5.0","kev":false},{"cve":"CVE-2026-107716","published":"2026-10-08","fixed":"2.5.1","kev":false}],"package":"PyPI:banks"}}