mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-05 01:27:28 +00:00
[PR #26] [CLOSED] Harden upload path handling in /files/upload #112
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/open-terminal#112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-terminal/pull/26
Author: @shuofengzhang
Created: 3/7/2026
Status: ❌ Closed
Base:
main← Head:fix-upload-path-safety📝 Commits (1)
bbd36f9Harden file upload path handling📊 Changes
1 file changed (+7 additions, -2 deletions)
View changed files
📝
open_terminal/main.py(+7 -2)📄 Description
What changed
os.path.basename(...)for both URL and multipart uploads.commonpathguard to ensure the final write path stays inside the requested upload directory.Why
UploadFile.filenamecan contain path segments from clients. Joining it directly can allow writes outside the intended destination./files/uploadbehavior consistent with other file endpoints and avoids accidental path traversal.Testing
source .venv/bin/activate && pytest -q🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.