Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

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

Method putUserProfile missing a server-side AuthZ check #19764

Closed
Assignees
mtojek
Labels
@jdomeracki-coder

Description

@jdomeracki-coder

Summary

MethodputUserProfile missing a server-side AuthZ check

Current Behavior

AMember user can make a followingPUT request to change theirusername

curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \  -H 'Content-Type: application/json' \  -H 'Accept: application/json' \  -H 'Coder-Session-Token: API_KEY' \  --data-raw '{"username":"jdoe","name":"John Doe"}'

https://coder.com/docs/reference/api/users#update-user-profile

This should not be the case as per:
#3286
#3649

Proposed Changes

We should explicitly check if given user has theupdate_personal permission (ActionUpdatePersonal) granted in their RBAC policy

if !api.Authorize(r, policy.ActionUpdatePersonal, user) {httpapi.ResourceNotFound(rw)return}

Also this is most likely a bug andpolicy.ActionUpdatePersonal should be removed from theMember role

// Users cannot do create/update/delete on themselves, but they
// can read their own details.
ResourceUser.Type: {policy.ActionRead,policy.ActionReadPersonal,policy.ActionUpdatePersonal},

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp