# CVE-2026-71492: Banks DirectoryPromptRegistry path traversal in set()

Source: https://junglewise.ai/threats/cve-2026-71492-banks-directorypromptregistry-path-traversal-in-set  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-20. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-71492 · Severity: medium · CVSS 4 · Published 2026-08-20

Banks is a Python library for managing prompt templates. An application that accepts user-supplied prompt names through an API and forwards them to the registry can be exploited to write arbitrary files anywhere the application process has write access. An authenticated attacker can plant malicious Jinja templates, clobber configuration files, or inject code into shared application directories, leading to template injection, configuration tampering, or cross-application compromise.

Technologies: [banks (PyPI)](https://junglewise.ai/threats/technologies/pypi-banks). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-71492 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-71492 being exploited in the wild.

**How severe is CVE-2026-71492?** Medium severity, with a CVSS score of 4, published 20 August 2026.

**Which products and versions are affected?** banks (PyPI) ECOSYSTEM:introduced=0,fixed=2.4.5; Masci Banks < 2.4.5.

**Is there a fix for CVE-2026-71492?** Yes. banks (PyPI): upgrade to 2.4.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-71492 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-71492?** Check whether you run banks (PyPI) or Masci Banks 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.5 or later

  ```sh
  pip install "banks>=2.4.5"
  ```


## Technical details

The vulnerability is a classic path traversal flaw in src/banks/registries/directory.py:44. The DirectoryPromptRegistry.set() method concatenates the user-controlled Prompt.name directly into a Path expression without validation or canonicalization: `prompt_file = path / f"{prompt.name}.{prompt.version}.jinja"`. This allows two attack vectors: (1) relative traversal using "../" sequences to escape the registry root, and (2) absolute path bypass where pathlib's `/` operator silently discards the left operand when the right is an absolute path. The poisoned name is persisted to index.json, so the escaping path reconstructs on subsequent _load() calls. The suggested fix involves strict allowlist validation (alphanumeric, dots, hyphens, underscores only) and post-canonicalization path containment checks. Fix available in v2.4.5.

## Affected products

- masci banks < 2.4.5

## Identifiers

- CVE-2026-71492
- GHSA-x8wg-4xgc-vr54
- PYSEC-2026-3810

## Timeline

- 2026-08-07: disclosed
- 2026-08-20: patched: v2.4.5 released
- 2026-09-02: advisory

## References

- [https://api.github.com/users/spbavarva](https://api.github.com/users/spbavarva)
- [https://github.com/spbavarva](https://github.com/spbavarva)
- [https://api.github.com/users/spbavarva/gists%7B/gist_id%7D](https://api.github.com/users/spbavarva/gists%7B/gist_id%7D)
- [https://api.github.com/users/spbavarva/repos](https://api.github.com/users/spbavarva/repos)
- [https://avatars.githubusercontent.com/u/84507631?v=4](https://avatars.githubusercontent.com/u/84507631?v=4)
- [https://api.github.com/users/spbavarva/events%7B/privacy%7D](https://api.github.com/users/spbavarva/events%7B/privacy%7D)

## Related threats

- [Banks Prompt chat role injection via user-controlled input](https://junglewise.ai/threats/cve-2026-107717-banks-user-controlled-prompt-input-can-be-parsed-as-privileged)
- [Banks DirectoryPromptRegistry symlink traversal arbitrary file disclosure and overwrite](https://junglewise.ai/threats/cve-2026-107716-banks-symlink-traversal-and-arbitrary-file-disclosure-overwrite)
- [masci banks remote code execution via unsafe Tool import_path](https://junglewise.ai/threats/cve-2026-61536-masci-banks-remote-code-execution-via-unsafe-tool-import-path)
