Summary
Vanna versions through 2.0.2 expose a path traversal flaw in the FileSystemConversationStore that processes conversation IDs supplied via unauthenticated chat API endpoints.
By injecting directory traversal sequences into the conversation_id parameter, attackers can write arbitrary JSON files and read conversation metadata from outside the intended storage directory, putting server files and data at risk.
Affected context
This vulnerability arises in Vanna deployments that use the FileSystemConversationStore for persisting chat conversations and expose its chat endpoints without authentication.
The issue manifests when user-supplied conversation identifiers are concatenated or otherwise mapped directly into filesystem paths relative to a base directory, without robust normalization or enforcement that the resulting path remains inside the designated storage root.
Exploit preconditions
- Attack surface: Public or internal HTTP(S) chat API endpoints that accept a conversation_id parameter.
- Required access: No prior authentication; any network client able to reach the chat API can attempt exploitation.
- Trigger point: FileSystemConversationStore read and write operations that translate conversation_id into a filesystem path for JSON persistence.
- Why exploitation is possible: The implementation accepts conversation_id values containing directory traversal sequences (e.g., "../") and uses them in path construction without proper canonicalization or validation, allowing access outside the intended base directory for both reads and writes.
Why this happens
The underlying bug is a classic path traversal issue as described by CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Instead of treating conversation identifiers as untrusted input that must be strictly constrained to a safe subset and validated against a canonicalized base path, the FileSystemConversationStore directly incorporates user-controlled values into filesystem paths. Without enforcing that the resolved path stays within the configured storage root, attackers can escape the base directory by including traversal sequences and target arbitrary locations on the server's filesystem during both read and write operations.
Potential impact
- Attackers may write arbitrary JSON files to locations outside the intended conversation store directory.
- Attackers could overwrite or corrupt existing application or data files, depending on process permissions.
- Attackers can read conversation metadata or other JSON-formatted data stored outside the base directory.
- Stored JSON payloads controlled by an attacker may later be consumed by other components, potentially enabling secondary attacks such as configuration tampering or data poisoning.
- Unauthorized access to sensitive information stored in readable JSON files, such as logs, cached responses, or internal metadata, can occur.
General mitigation guidance
Effective mitigation focuses on strictly constraining how user-controlled identifiers are mapped to filesystem paths and minimizing trust in input-derived locations.
Pattern-based mitigations include:
- Applying rigorous validation to conversation IDs, restricting them to a known-safe character set and fixed structural format (for example, UUID-like identifiers or server-generated tokens), rather than arbitrary strings.
- Resolving constructed paths to their canonical (absolute) form and enforcing that they remain within the configured base directory before performing any filesystem operation.
- Avoiding direct concatenation of untrusted input into path strings; instead, use mapping layers or key-value stores that decouple external identifiers from internal filesystem layout.
- Running the service under a dedicated, least-privileged account with limited filesystem access so that even if path traversal is attempted, the process cannot touch sensitive system locations.
- Isolating persistence storage into a dedicated directory or volume with narrow permissions, and considering sandboxing or containerization controls to further limit filesystem exposure.
How teams detect issues like this
Detection efforts can center on both code-level analysis and runtime monitoring:
- Static analysis rules can flag direct concatenation or formatting of untrusted parameters (such as conversation_id) into filesystem paths, especially when no canonicalization or boundary checks against a base directory are present.
- Code review checklists can include explicit questions about how user identifiers are translated into storage locations, encouraging reviewers to verify that path normalization, whitelisting, and base-directory enforcement are implemented.
- Security linters or application security testing tools can be configured to look for functions that perform file access (open, write, read) combined with user-derived arguments, highlighting potential path traversal risks.
- Runtime logging and alerting can be configured to detect suspicious patterns in identifiers (e.g., presence of "../", absolute path prefixes, or unusual directory structures) and flag or block such requests.

