GHSA-crh6-pj8c-xrhc

Suggest an improvement
Source
https://github.com/advisories/GHSA-crh6-pj8c-xrhc
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/03/GHSA-crh6-pj8c-xrhc/GHSA-crh6-pj8c-xrhc.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-crh6-pj8c-xrhc
Aliases
Published
2025-03-20T12:32:45Z
Modified
2025-03-21T17:43:17.386713Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H CVSS Calculator
Summary
Open WebUI Allows Arbitrary File Write via the `/models/upload` Endpoint
Details

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 of file_path = f"{UPLOAD_DIR}/{file.filename}" without proper input validation or sanitization. An attacker can exploit this by manipulating the file.filename parameter to include directory traversal sequences, causing the resulting file_path to escape the intended UPLOAD_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.

Database specific
{
    "github_reviewed": true,
    "nvd_published_at": "2025-03-20T10:15:35Z",
    "cwe_ids": [
        "CWE-22"
    ],
    "github_reviewed_at": "2025-03-21T17:30:06Z",
    "severity": "MODERATE"
}
References

Affected packages

PyPI / open-webui

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
0.3.8

Affected versions

0.*
0.1.124
0.1.125
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.2.5
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6
0.3.7
0.3.8

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/03/GHSA-crh6-pj8c-xrhc/GHSA-crh6-pj8c-xrhc.json"