Skip to content

Commit 7bd2991

Browse files
authored
fix(identity): check for bad chars in user names (#1622)
1 parent 70ac304 commit 7bd2991

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/identity/app/controllers/identity/projects/role_assignments_controller.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ def update
3030
new_roles = params[:roles]
3131
new_role_assignments = []
3232

33+
begin
34+
URI.parse(user_id)
35+
rescue URI::InvalidURIError
36+
render json: { errors: "Invalid user Name/ID format, do not use special characters" }
37+
return
38+
end
39+
3340
# render empty list if no project id provided
3441
render json: { roles: [] } && return if scope_project_id.blank?
3542

0 commit comments

Comments
 (0)