Skip to main content
Menu
Advisories

Confused-deputy BAC in the direct-upload endpoint

GHSA-22J9-2W6R-J7C2Published Updated GitHub

Description

Impact

A low-privilege authenticated user can obtain a presigned upload URL for any path within their own BasePath that per-path meta write-restrictions should forbid, fully bypassing those write restrictions.

Proof of Concept

The FsUp middleware (server/middlewares/fsup.go) authorizes the File-Path request header, but the handler FsGetDirectUploadInfo (server/handles/direct_upload.go) builds the destination from the body field req.Path with only user.JoinPath and no CanWrite check. Send POST /api/fs/get_direct_upload_info with header File-Path: /allowed and body {"path":"/restricted","file_name":"x","tool":"...","file_size":1}; the response contains a presigned upload URL for /restricted/x.

Affected versions

References

GitHub · OpenListTeam/OpenList