Skip to content
MediumVulnerability

GHSA-x8wg-4xgc-vr54: Banks: Path traversal in `DirectoryPromptRegistry.set()` allows arbitrary file write outside the registry root

Published
Record updated
View JSON
Affected
  • banks < 2.4.5
Fixed in
2.4.5
  • released July 7, 2026, 57 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.4%Estimated probability that this CVE is exploited in the next 30 days, from the FIRST Exploit Prediction Scoring System. Read on .

Summary

`DirectoryPromptRegistry.set()` in Banks interpolates the `Prompt.name` value into a file path without canonicalization, so an application that derives the name from request data lets a caller write attacker-controlled bytes outside the configured registry directory. Relative traversal (`../`) and absolute paths (which `pathlib` lets override the registry root) both work, and the poisoned name persists in `index.json`. The advisory's verified output used `banks==2.4.2`.

Mitigation

Suggested fix in the source: validate `prompt.name` against the regex `[A-Za-z0-9._-]+` early in `src/banks/registries/directory.py` and verify that the resulting path stays under the registry root after canonicalization. The source's suggested-fix snippet is truncated, so no fixed release version is stated.