Security: is_read_only enforced on only one endpoint #77

Closed
opened 2026-07-08 02:40:29 +00:00 by icub3d · 0 comments
Owner

Severity: High — found in code review 2026-07-07.

Problem

The is_read_only session flag (used for unapproved/revoked bots) is enforced on exactly one endpoint: server/src/messages/handlers.rs:142. A grep confirms no other handler checks it.

A read-only session can still: add/remove reactions, upload attachments (attachments/handlers.rs:101), edit/delete its own messages, update its profile, and create invites. The read-only guarantee is effectively cosmetic.

Fix

Enforce is_read_only centrally — reject read-only sessions for all mutating routes in the MemberUser/permission extractor, rather than per-handler.

Acceptance

  • Read-only session is rejected on reactions, attachments, message update/delete, profile update, invite create
  • Tests cover at least reactions + attachments + profile
**Severity: High** — found in code review 2026-07-07. ## Problem The `is_read_only` session flag (used for unapproved/revoked bots) is enforced on exactly one endpoint: `server/src/messages/handlers.rs:142`. A grep confirms no other handler checks it. A read-only session can still: add/remove reactions, upload attachments (`attachments/handlers.rs:101`), edit/delete its own messages, update its profile, and create invites. The read-only guarantee is effectively cosmetic. ## Fix Enforce `is_read_only` centrally — reject read-only sessions for all mutating routes in the `MemberUser`/permission extractor, rather than per-handler. ## Acceptance - [ ] Read-only session is rejected on reactions, attachments, message update/delete, profile update, invite create - [ ] Tests cover at least reactions + attachments + profile
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
icub3d/decentcom#77
No description provided.