Summary
Open WebUI audio uploads prior to version 0.6.10 accept user-supplied filenames without validation or sanitization, allowing dot-segments and directory traversal sequences.
Under these conditions, a user can cause uploaded audio files to be written outside the intended uploads directory to any location writable by the web server process, potentially overwriting or planting files in sensitive paths.
Affected context
This vulnerability occurs in Open WebUI deployments that expose the audio upload functionality and derive the target filesystem path directly from the HTTP upload's original filename.
The issue is present when the upload handler:
- Concatenates user-controlled filenames with a base uploads directory
- Does not normalize paths or reject dot-segments (e.g.,
../) - Relies on filesystem behavior rather than explicit path enforcement
It becomes significant in environments where the web server user has write permissions to directories beyond the intended uploads folder.
Exploit preconditions
- Attack surface: HTTP audio upload endpoint exposed to users (local or remote depending on deployment).
- Required access: Ability to submit file upload requests (typically any authenticated or sometimes unauthenticated user allowed to upload audio).
- Trigger point: Submitting an audio file with a crafted filename containing directory traversal sequences (e.g., dot-segments) in the upload request.
- Why exploitation is possible: The server constructs the destination path using the unvalidated filename, enabling traversal out of the designated uploads directory into arbitrary writable paths.
Why this happens
The root cause is the direct use of user-controlled filenames to build filesystem paths without enforcing directory boundaries or sanitizing traversal patterns.
This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where an application intends to restrict file operations to a specific directory but fails to strip or reject sequences such as ../, absolute paths, or device paths.
Conceptually, the bug class is "string concatenation of paths with untrusted input" instead of using canonicalization, normalization, and explicit checks against an allowed base directory, allowing attackers to escape the intended upload folder.
Potential impact
- Users could write files to arbitrary locations that the web server user can access.
- Uploaded files could overwrite existing application or configuration files, potentially disrupting service.
- Placement of files into web-served directories could enable content spoofing or facilitate other attacks (e.g., serving attacker-controlled assets).
- Log files or auxiliary data could be manipulated, complicating monitoring and incident response.
- In combination with other weaknesses (such as executable upload handling), this could contribute to code execution scenarios.
General mitigation guidance
Effective mitigation focuses on enforcing strict directory boundaries and treating filenames as data, not paths:
- Resolve all upload destinations by joining a fixed, server-side base directory with a sanitized filename that strips or replaces path separators and dot-sequences.
- Normalize and canonicalize resulting paths, then verify that they reside within the intended uploads directory before writing any file.
- Generate server-side filenames (e.g., UUIDs, hashes) independent of user-provided names, storing the original name only as metadata where needed.
- Limit the web server process to minimal write permissions, isolating upload directories from application code, configuration, and system paths.
- Apply defense-in-depth controls such as chroot jails, containers, or file system ACLs to constrain damage if traversal bugs occur.
How teams detect issues like this
Organizations can detect and monitor for this class of issue using several approaches:
- Static analysis: Flag code that concatenates user-controlled strings (such as HTTP filenames) into filesystem paths without normalization and boundary checks.
- Code review: Look for upload handlers that trust
filenamemetadata from requests, and verify they enforce an allowed directory and sanitize disallowed characters and sequences. - Runtime monitoring: Inspect application logs and filesystem activity for uploads resulting in paths outside expected upload directories, or for unexpected file creations in sensitive locations.
- Security testing: Include path traversal payloads in upload tests, ensuring that attempted traversal sequences are either rejected or normalized to safe locations.

