Vulnerability · Published Oct 8, 2026 · Assigned by GitHub_M
CVE-2026-107717Banks: User-controlled prompt input can be parsed as privileged chat messages
Medium 6.5
In plain English
A medium-severity improper input validation in banks from masci. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 27% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Banks generates meaningful LLM prompts using a simple template language. Prior to 2.5.0, Banks Prompt.chat_messages() attempts to parse every line of rendered template output as ChatMessage JSON. When an application renders untrusted data and passes the returned ChatMessage objects to an LLM provider, attacker-controlled JSON can cross the prompt boundary and become a system, assistant, or tool message because ChatMessage.role accepts arbitrary strings. This can override application instructions, alter the intended prompt structure, or confuse downstream tool and message handling. This issue is fixed in version 2.5.0.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | banks | 2.5.0 | GHSA-hmq2-7hp6-7crh |
| PyPI | banks | 2.5.0 | PYSEC-2026-4202 |
Affected products (as reported)
Weakness: CWE-20 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
References
- https://github.com/masci/banks/security/advisories/GHSA-hmq2-7hp6-7crh x_refsource_CONFIRM
- https://github.com/masci/banks/pull/78 x_refsource_MISC
- https://github.com/masci/banks/commit/02172b816fb84f6a824cc09a8aca7416f53c12cb x_refsource_MISC
- https://github.com/masci/banks/releases/tag/v2.5.0 x_refsource_MISC