banks is vulnerable to Path Traversal
59
Medium Risk
The DirectoryPromptRegistry in banks builds prompt file paths by interpolating the prompt name and version directly into a filesystem path without validation. Calling set() with a name or version that contains an absolute path or .. segments writes the prompt file outside the registry root, and loading a crafted index.json reconstructs stored paths the same unsafe way. An attacker who can influence stored prompt names, versions, or the on-disk index can write or overwrite files outside the intended directory. The fix adds _resolve_prompt_file(), which rejects absolute and dot-segment names and versions and enforces that the resolved path stays within the registry root.
You are affected if you are using a version that falls within the vulnerable range and your application passes untrusted prompt names, versions, or index data to DirectoryPromptRegistry.
banks is vulnerable to Path Traversal in versions 0.6.0 - 2.4.4.
Upgrade the banks library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant