Summary
A directory traversal flaw in Pipecat's development runner file download endpoint allows attackers to escape the configured folder and read arbitrary files on the host filesystem.
When the runner is exposed over the network, a crafted path parameter can bypass normalization and access any file the Pipecat process can read, including sensitive keys and system configuration.
Affected context
This vulnerability appears in Pipecat deployments that:
- Use the development runner (
src/pipecat/runner/run.py) - Start the runner with the
--folderflag, enabling the/files/{filename:path}endpoint - Expose the runner over a network interface reachable by untrusted clients
The risk is most significant in environments where the Pipecat process has access to sensitive files, such as SSH keys, application secrets, or system configuration files.
Exploit preconditions
- Attack surface: HTTP GET requests to the
/files/{filename:path}endpoint on the Pipecat dev runner. - Required access: Network reachability to the running Pipecat instance; no authentication is required by default.
- Trigger point: Supplying a crafted
filenamepath segment containing URL-encoded traversal sequences (e.g.,..%2F) that are decoded after routing. - Why exploitation is possible: The implementation concatenates the untrusted
filenameparameter directly toargs.folderwithout containment checks or canonicalization, and relies on framework normalization that does not account for encoded separators, allowing traversal outside the intended directory.
Why this happens
The underlying issue is unvalidated construction of filesystem paths from user-controlled input without enforcing directory boundaries.
In the affected code, the filename route parameter is appended to the base directory specified by --folder and then used to read and return file contents.
Because there is no normalization and containment check on the fully resolved path, encoded .. path segments are interpreted by the filesystem, enabling escape from the base directory.
This behavior corresponds to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where an application fails to ensure that a computed path stays within an expected root.
Potential impact
- Attackers may read arbitrary files that the Pipecat process user can access.
- Sensitive credentials, SSH private keys, API tokens, and configuration secrets could be exposed.
- Application source code, logs, and internal configuration files can be disclosed, aiding further attacks.
- System-level files (e.g.,
/etc/passwd) can be read, revealing user and environment information for reconnaissance.
General mitigation guidance
Effective mitigation focuses on constraining file access and hardening path handling:
- Enforce strict containment by resolving the requested path to an absolute, normalized form and verifying it remains within the configured base directory before opening any file.
- Use dedicated helper functions or libraries for safe path joining that explicitly guard against traversal segments (
..) and encoded separators. - Limit the privileges of the Pipecat process so it only has read access to non-sensitive directories required for development.
- Avoid exposing development-only file-serving endpoints to untrusted networks; restrict them to localhost or protected environments.
- Implement optional allowlists of permitted file types or subdirectories for any file download features.
How teams detect issues like this
Organizations can detect and monitor for this class of issue using:
- Static analysis rules or custom linters that flag direct concatenation of HTTP route parameters or query strings into filesystem paths.
- Code review checklists that explicitly ask reviewers to verify canonicalization and containment checks around file-serving endpoints.
- Security testing that includes fuzzing of file download routes with traversal patterns, including URL-encoded separators (
%2F,%5C). - Runtime monitoring and logs that highlight access to unexpected filesystem locations through HTTP endpoints, especially files outside the intended serving directory.

