CVE-2026-71492 Banks: Path traversal in `DirectoryPromptRegistry.set()` allows arbitrary file write outside the registry root
Attackers can write arbitrary files outside the registry root via path traversal in DirectoryPromptRegistry.set(), potentially compromising the application process.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-71492?
CVE-2026-71492 is a medium-severity path traversal vulnerability in masci banks, published on 20 Aug 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Weakness: CWE-22
Which versions are affected by CVE-2026-71492?
3 open source packages ship an affected version, including banks.
| Package | Affected | Fixed in |
|---|---|---|
banks PyPI | All versions | 2.4.5 |
banks PyPI | All versions | 2.4.5 |
banks PyPI | All versions | 2.4.5 |
How do I fix CVE-2026-71492?
Upgrade banks to 2.4.5 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-71492 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-71492 exists.
Sources
Also known as GHSA-x8wg-4xgc-vr54, PYSEC-2026-3810.