Commit Graph

8 Commits (704503e5564a10ee431ef15a09ae01b3d0ca88e3)

Author SHA1 Message Date
Steven 704503e556 fix(store): allow memo/attachment deletion when local file is missing
Fixes two bugs reported in #5603:

1. store/attachment.go: ignore os.ErrNotExist when removing a local
   attachment file so that a missing file on disk (broken state from
   failed uploads) no longer blocks deletion of the DB record, allowing
   memos referencing corrupt attachments to be deleted normally.

2. memo_attachment_service.go: add nil guard on GetAttachment result
   before dereferencing it in SetMemoAttachments, preventing a nil
   pointer panic when an attachment UID no longer exists in the DB.
4 months ago
Johnny c7b48b800f fix: add access control checks for attachments, comments, and reactions
Security fixes for multiple authorization bypass vulnerabilities:

- GetAttachment: Add visibility check via checkAttachmentAccess helper
- UpdateAttachment: Add ownership check (creator or admin only)
- Fileserver: Require creator/admin auth for unlinked attachments
- ListMemoAttachments: Add memo visibility check
- CreateMemoComment: Add memo visibility check for target memo
- ListMemoReactions: Add memo visibility check
- UpsertMemoReaction: Add memo visibility check

All checks follow the existing pattern used in GetMemo for consistency.
5 months ago
Johnny 7932f6d0d0
refactor: user auth improvements (#5360) 6 months ago
boojack 21d31e3609
fix(security): implement security review recommendations (#5228)
Co-authored-by: Claude <noreply@anthropic.com>
7 months ago
Florian Dewald 769dcd0cf9
fix(security): add missing authorization checks to various services (#5217) 7 months ago
varsnotwars 4eb5b67baf
feat: attachments by id (#5008) 10 months ago
Steven a4920d464b refactor: attachment service part2 1 year ago
Steven bb5809cae4 refactor: attachment service 1 year ago