AOSSIE-Org / AOSSIE-Org/Ell-ena

BUG: Critical server-side authorization missing for ticket/task/meeting mutations

Open
#148 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
54
Forks
110
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

**Issue Overview**
Several sensitive operations (such as assigning tickets, updating status/priority, deleting meetings or tasks) are executed directly from the client using the Supabase SDK. These operations rely on UI checks or assumptions that Row Level Security (RLS) will always enforce correct permissions.

If RLS policies are missing, relaxed, or modified in the future, any authenticated user could perform privileged actions across teams or roles.

This creates a broken access control risk where security depends on external configuration rather than guaranteed server-side enforcement.

**Steps to Reproduce**

1. Log in as a normal team member (non-admin).
2. Intercept or modify a client request (or call the SDK directly).
3. Call any of the following methods with arbitrary IDs:
- assignTicket
- updateTicketStatus
- updateTicketPriority
- updateMeeting
- deleteMeeting
4. Observe that the client allows the request to be sent without validating role or ownership.
(If RLS is misconfigured, the operation will succeed.)

**Expected Behavior**
All privileged mutations should be enforced strictly on the server:
- Only team members can modify resources of their team.
- Only admins (or creators) can assign, delete, or update approval/status fields.
- Authorization should be guaranteed via RLS policies or SECURITY DEFINER RPC functions, not UI logic.

**Actual Behavior**
The client directly executes update/delete operations and assumes the database will block unauthorized actions. There is no hard guarantee in the client layer that the caller has sufficient permissions.

Security currently depends entirely on RLS correctness.

**Suggested Improvements**

Move all privileged operations to one of:
1. Strict Row Level Security (RLS) policies for each table (tickets, tasks, meetings, comments).
2. Or dedicated RPC functions that validate:

- team membership
- role (admin/member)
- ownership (creator)

This ensures that even if client logic is bypassed, unauthorized actions are impossible.

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.