Skip to content
MediumVulnerability

GHSA-556j-vv39-8rqv: Banks: Symlink traversal and arbitrary file disclosure/overwrite in DirectoryPromptRegistry

Published
Record updated
View JSON
Affected
  • banks <= 2.5.0
Fixed in
2.5.1
  • released September 10, 2026, 28 days before disclosure

Summary

The banks.registries.DirectoryPromptRegistry class does not refuse symbolic links for prompt file paths or for index.json. When a prompt directory holds untrusted files, such as unpacked archives or shared folders, a symlink pointing outside the registry root lets an attacker disclose arbitrary files through _scan() and get(), or overwrite them through set() and _save(). The impact is classified as CWE-59 and CWE-200.

Mitigation

The source describes these remediation steps: in _validate_index_path(), verify that _index_path is not a symlink and resolves within _path; in _scan(), reject path.is_symlink() and check that path.resolve().is_relative_to(root); in set(), reject existing symbolic links before writing. A tested fix and regression tests are available at https://github.com/jankesec/banks/tree/fix-directory-registry-symlinks-and-nesting.