Skip to content

fix(server): reject forged upload context paths#348

Open
herikwebb wants to merge 1 commit into
plmbr:mainfrom
herikwebb:security/fix-upload-path-sandbox
Open

fix(server): reject forged upload context paths#348
herikwebb wants to merge 1 commit into
plmbr:mainfrom
herikwebb:security/fix-upload-path-sandbox

Conversation

@herikwebb
Copy link
Copy Markdown
Contributor

Require WebSocket upload attachments to resolve under the server upload root before image reads or Claude Code file mentions use the supplied path. This closes the forged isUpload attack path that let an authenticated client point chat context at arbitrary server-readable files outside the workspace.

Require WebSocket upload attachments to resolve under the server upload
root before image reads or Claude Code file mentions use the supplied
path. This closes the forged isUpload attack path that let an
authenticated client point chat context at arbitrary server-readable
files outside the workspace.
@pjdoland pjdoland added the bug Something isn't working label May 26, 2026
Copy link
Copy Markdown
Collaborator

@pjdoland pjdoland left a comment

Choose a reason for hiding this comment

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

LGTM. The commonpath containment check is correct (component-based, not string-prefix), symlink resolution via realpath on both sides is the right approach, and the two-branch partition (isUpload -> upload root, else -> workspace root) closes the vector cleanly. Test updates are a nice pattern improvement.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants