Skip to content

fix(object-storage): stop GET_PRESIGNED_URL leaking another member's home folder - #7976

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/get-presigned-url-personal-home-leak-w4
Oct 15, 2026
Merged

pedrofrxncx merged 1 commit into
mainfrom
fix/get-presigned-url-personal-home-leak-w4

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

GET_PRESIGNED_URL hands back a presigned download URL for any key in the org's bucket, including _fs/home/users/<id>/... — the Library's object-storage addressing for org-fs bytes. That bypasses the personal-home carve-out the /api/:org/fs routes (and PUT_PRESIGNED_URL, fixed in #7885) already enforce: org-fs.ts's ACL note says every member reads/writes every volume except another member's home/users/<id>/ folder. Before this fix, any org member could call GET_PRESIGNED_URL with a teammate's _fs/home/users/<other-id>/notes.md key and get a working download URL for their private notes, with no other guardrail in the way.

Fix: reject _fs/ keys whose path falls inside another member's personal home, by applying the same canReadPersonal check the fs routes use — mirroring the requireOrgFsWrite guard PUT_PRESIGNED_URL already applies on the write side.

Failure scenario: org member A calls GET_PRESIGNED_URL with key: "_fs/home/users/<B's user id>/notes.md" and receives a presigned URL that serves B's private file bytes directly from S3, with no further check.

Reviewer: run bun test apps/api/src/tools/object-storage/get-presigned-url.test.ts — it covers both the rejected cross-member read and that the caller's own home files / shared volumes still presign normally.

Verified locally: bun run fmt, bunx tsc --noEmit in apps/api (clean), the targeted test file above (3 pass), and oxlint on the three changed files (clean, no ×/⚠). Full CI validates the rest.

🤖 Generated with Claude Code


Summary by cubic

Fixes GET_PRESIGNED_URL so org members can no longer obtain presigned download URLs for another member's private Library home folder. The tool previously presigned any key in the bucket, including _fs/home/users/<id>/..., bypassing the personal-home carve-out that the /api/:org/fs routes and PUT_PRESIGNED_URL already enforce. _fs/ keys that fall inside another member's personal home are now rejected with a forbidden error, while the caller's own home files and shared volumes still presign normally.

Written for commit 7b3205a. Summary will update on new commits.

View guided diff Turn on auto-fix

…home folder

GET_PRESIGNED_URL hands back a presigned download URL for any key in the
org's bucket, including `_fs/home/users/<id>/...` — the Library's
object-storage addressing for org-fs bytes. That bypasses the personal-home
carve-out the `/api/:org/fs` routes and PUT_PRESIGNED_URL already enforce
(org-fs.ts's ACL note: every member reads/writes every volume except another
member's `home/users/<id>/` folder), letting any org member read a
teammate's private notes by presigning the raw key instead of going through
the fs read route.

Reject `_fs/` keys whose path falls inside another member's personal home,
mirroring the `requireOrgFsWrite` guard PUT_PRESIGNED_URL already applies on
the write side (see #7885).

Reviewer: run `bun test apps/api/src/tools/object-storage/get-presigned-url.test.ts`.

Verified locally: `bun run fmt`, `tsc --noEmit` in apps/api, the targeted
test file above (3 pass), and `oxlint` on the three changed files (clean).
Full CI validates the rest.
@github-actions github-actions Bot added the claude PR authored by a coding agent label Oct 15, 2026
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) October 15, 2026 13:30
@pedrofrxncx
pedrofrxncx merged commit e88f700 into main Oct 15, 2026
33 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/get-presigned-url-personal-home-leak-w4 branch October 15, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant