Skip to content

fix(server): refuse to upload through a symlink - #465

Merged
BaaRai merged 2 commits into
BaaRai:mainfrom
Coff0xc:fix/upload-no-symlink
Nov 22, 2026
Merged

BaaRai merged 2 commits into
BaaRai:mainfrom
Coff0xc:fix/upload-no-symlink

Conversation

@Coff0xc

@Coff0xc Coff0xc commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

os.Create follows a symlink, and Stat treats a dangling symlink as missing. Destinations are Lstat-ed, a symlink is rejected, and the chat name search treats a link as taken. go test ./server/ -run TestRefuseUploadSymlink passes.

os.Create follows a symlink, and Stat treats a dangling link as missing, so a
name planted in the uploads directory could redirect the server's write.
Destinations are now Lstat'd, a symlink is rejected, and the chat name search
treats a link as taken.
Copilot AI balanced review requested due to automatic review settings November 21, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

# Conflicts:
#	CHANGELOG.md
#	server/chatupload.go
@BaaRai
BaaRai merged commit 449065a into BaaRai:main Nov 22, 2026
5 checks passed
@BaaRai

BaaRai commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Thanks @Coff0xc, merged. The upload path now uses Lstat, treats a dangling link as occupied, and refuses to write through a symlink. The merge commit reconciles this with the bounded uniqueUploadPath from #459; it only brings the branch onto main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants