CVE-2026-61536: masci banks remote code execution via unsafe Tool import_path

CVE-2026-61536 · Severity: high · CVSS 7.5 · Published 2026-07-30

Banks is a library used to generate prompts for Large Language Models (LLMs) using a template language. A vulnerability exists where the library incorrectly trusts instructions within a template to load and execute any Python function on the host server. If an attacker can influence the content of a template—such as through a shared database or file system—they can execute arbitrary code, potentially leading to a full system takeover or data breach.

Technologies: Masci Banks, banks (PyPI). Vendors: Masci, PyPI.

Quick answers

Is CVE-2026-61536 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-61536 being exploited in the wild.
How severe is CVE-2026-61536?
High severity, with a CVSS score of 7.5, published 30 July 2026.
Which products and versions are affected?
Masci Banks < 2.4.3; banks (PyPI) <= 2.4.2, ECOSYSTEM:introduced=0,fixed=2.4.3.
Is there a fix for CVE-2026-61536?
Yes. banks (PyPI): upgrade to 2.4.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-61536 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-61536?
Check whether you run Masci Banks or banks (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • banks (PyPI): upgrade to 2.4.3 or later
    pip install "banks>=2.4.3"

Technical details

In Banks versions prior to 2.4.3, the CompletionExtension parses Tool JSON objects directly from the rendered body of {% completion %} blocks. The library uses the 'import_path' field from this JSON to resolve a callable via importlib.import_module() and getattr() without any allowlist or sanitization. An attacker who can provide a malicious template can specify dangerous Python functions (e.g., 'os.system') in the 'import_path'. When the LLM triggers a tool call matching the attacker-defined tool name, the library executes the specified function with attacker-controlled arguments. This bypasses previous sandboxing efforts (CVE-2026-44209) because the vulnerability exists in the Python-level tool resolution logic rather than the Jinja2 template environment.

Affected products

  • masci banks < 2.4.3

Identifiers

  • CVE-2026-61536
  • GHSA-64vx-6h2c-rjh7

Timeline

  • 2026-06-26: advisory: GitHub Security Advisory GHSA-64vx-6h2c-rjh7 published
  • 2026-07-30: disclosed: CVE-2026-61536 assigned
  • 2026-07-30: patched: Fixed in version 2.4.3

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.