[BUG] User can escalate theirs privilege #46
Labels
No labels
backend
bug
documentation
duplicate
enhancement
fix
frontend
help wanted
infrastructure
invalid
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
PoweredDeveloper/radix-vpn#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
Self-service privilege escalation via PATCH /users/me — backend/src/modules/users/schemas.py:22-27 defines UserUpdate with role, balance, status, subscription_id, and routes.py:45-64 applies it to the caller's own account. Any authenticated user can set their own role: "admin" and balance to anything. PATCH /users/{id} (routes.py:182-211) has the same flaw.
Make separate authentication token for admin. usual users shouldn be able to call /users/{id} endpoints. i.e. PATCH /users/{id} (routes.py:182-211).
GET /users/{id}- show all fields.GET /users/{id}- show safe fields, if user calls itself, show all fields.Admin role is never enforced — UserRole.ADMIN exists but no endpoint checks it. Package CRUD, GET /users, GET /payments are "admin" by shared-secret only.
Checklist