The vulnerability exists in the download_file function located within src/pipecat/runner/run.py. This function acts as a route handler for the /files/{filename:path} endpoint. The core of the vulnerability lies in the unsafe handling of the filename path parameter. The code originally took the filename and directly joined it with a base folder path using pathlib.Path. However, it failed to validate or sanitize the input filename. Web frameworks like Starlette (used by FastAPI) normalize paths containing ../, but they decode URL-encoded characters like %2F after the routing and path matching is complete. This allows an attacker to craft a malicious filename such as ..%2F..%2Fetc%2Fpasswd. When the download_file function receives this, the %2F has been decoded to /, resulting in a path traversal (../../etc/passwd) that allows reading arbitrary files outside of the intended downloads folder. The patch commit 7519c26ac5508573c35fa3a9c4717b013993d129 confirms this by replacing the insecure path concatenation with a call to a new _resolve_download_path function, which explicitly resolves the path and performs a containment check to ensure the final path is within the allowed base directory, thus mitigating the path traversal vulnerability.