fix: validate roles in VerifyEmail HTTP handler by lakhansamani · Pull Request #497 · authorizerdev/authorizer

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@lakhansamani

Copy link Copy Markdown

Contributor

Summary

  • Added role validation for ?roles= query parameter in VerifyEmail HTTP handler
  • Roles are now checked against user's stored roles using validators.IsValidRoles()
  • Prevents privilege escalation via URL manipulation

Test plan

  • Verify email verification with no roles param works (uses user's stored roles)
  • Verify email verification with valid roles subset works
  • Verify email verification with unauthorized roles returns 400

Fixes #486

Roles from the query string were used without validation against the
user's stored roles, allowing privilege escalation via URL manipulation.

Fixes #486

@lakhansamani lakhansamani merged commit 6486586 into main

Mar 1, 2026

@lakhansamani lakhansamani deleted the fix/verify-email-handler-role-validation branch

March 1, 2026 07:08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

VerifyEmail HTTP handler accepts roles from query string without validation

1 participant

@lakhansamani