fix(admin): reject unknown roles in the user-role change handler (BUNYIP-114) #153

Merged
vas2000-work merged 1 commit from fix/BUNYIP-114-role-enum-validation into main 2026-06-17 02:55:19 +02:00
Owner

user_role forwarded f.role verbatim to the API with no enum check, so a crafted request could submit an arbitrary role string. Accept only the known roles (admin / subscriber) and redirect without calling the API otherwise.

Verified with a targeted in-container fmt + clippy on bunyip-web (TARGETED_EXIT=0). The full just check-container OOMs locally on the unrelated async-stripe dependency; Forgejo CI builds the workspace cleanly.

Fixes BUNYIP-114.

user_role forwarded f.role verbatim to the API with no enum check, so a crafted request could submit an arbitrary role string. Accept only the known roles (admin / subscriber) and redirect without calling the API otherwise. Verified with a targeted in-container fmt + clippy on bunyip-web (TARGETED_EXIT=0). The full just check-container OOMs locally on the unrelated async-stripe dependency; Forgejo CI builds the workspace cleanly. Fixes BUNYIP-114.
fix(admin): reject unknown roles in the user-role change handler
All checks were successful
Check / fmt / clippy / build / test (pull_request) Successful in 1m55s
Create release / Create release from merged PR (pull_request) Has been skipped
fb44e45e92
user_role forwarded f.role verbatim to the API with no enum check, so a
crafted request could submit an arbitrary role string. Accept only the
known roles (admin / subscriber) and redirect without calling the API
otherwise. Verified with a targeted in-container fmt + clippy on
bunyip-web (the full check-container OOMs on the unrelated async-stripe
dependency).

#BUNYIP-114

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vas2000-work deleted branch fix/BUNYIP-114-role-enum-validation 2026-06-17 02:55:19 +02:00
Sign in to join this conversation.
No reviewers
No labels
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
psa-systems/bunyip!153
No description provided.