Open WebUI Allows Arbitrary File Write via the `/models/upload` Endpoint
Moderate severity
GitHub Reviewed
Published
Mar 20, 2025
to the GitHub Advisory Database
•
Updated Mar 21, 2025
Description
Published by the National Vulnerability Database
Mar 20, 2025
Published to the GitHub Advisory Database
Mar 20, 2025
Reviewed
Mar 21, 2025
Last updated
Mar 21, 2025
In open-webui version 0.3.8, the endpoint
/models/upload
is vulnerable to arbitrary file write due to improper handling of user-supplied filenames. The vulnerability arises from the usage offile_path = f"{UPLOAD_DIR}/{file.filename}"
without proper input validation or sanitization. An attacker can exploit this by manipulating thefile.filename
parameter to include directory traversal sequences, causing the resultingfile_path
to escape the intendedUPLOAD_DIR
and potentially overwrite arbitrary files on the system. This can lead to unauthorized modifications of system binaries, configuration files, or sensitive data, potentially enabling remote command execution.References