Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

rvierdiiev - AccessControlFacet doesn't have ability to set admin for the role #90

Closed
Tracked by #866
sherlock-admin2 opened this issue Jan 10, 2024 · 69 comments
Closed
Tracked by #866
Assignees
Labels
Escalation Resolved This issue's escalations have been approved/rejected Non-Reward This issue will not receive a payout Price: 200 USD Priority: 1 (Normal) Sponsor Confirmed The sponsor acknowledged this issue is valid Time: <1 Day Will Fix The sponsor confirmed this issue will be fixed

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Jan 10, 2024

rvierdiiev

medium

AccessControlFacet doesn't have ability to set admin for the role

Summary

AccessControlFacet doesn't have ability to set admin for the role.

Vulnerability Detail

AccessControlFacet is created to allow protocol manage different roles. Facet extends AccessControlInternal, which has different methods and uses LibAccessControl library to store executed roles actions.

While LibAccessControl library has setRoleAdmin function, both AccessControlFacet and AccessControlInternal don't use it. And as result it's not possible to set admin for the role.

Because of that only default admin will be used as parent role and protocol will not be able to granulary manage their roles.

Impact

Admin for the role can't be set.

Code Snippet

Provided above

Tool used

Manual Review

Recommendation

Add function on the facet that will set admin for the role.

@github-actions github-actions bot added the Excluded Excluded by the judge without consulting the protocol or the senior label Jan 14, 2024
@sherlock-admin2
Copy link
Contributor Author

1 comment(s) were left on this issue during the judging contest.

auditsea commented:

Owner is set as a default admin, it should work

@github-actions github-actions bot reopened this Jan 16, 2024
@github-actions github-actions bot added Medium A valid Medium severity issue Has Duplicates A valid issue with 1+ other issues describing the same vulnerability and removed Excluded Excluded by the judge without consulting the protocol or the senior labels Jan 16, 2024
@sherlock-admin2
Copy link
Contributor Author

1 comment(s) were left on this issue during the judging contest.

auditsea commented:

Owner is set as a default admin, it should work

@molecula451
Copy link

molecula451 commented Jan 16, 2024

this looks like an invalid because the admin can set new roles:

by "granting" its just the function its named grantRoles instead of set!

the submission claims that the Facet don't use it, the admin can indeed use it!

@rndquu @gitcoindev

@gitcoindev
Copy link

Granting roles is tested at https://github.com/sherlock-audit/2023-12-ubiquity/blob/d9c39e8dfd5601e7e8db2e4b3390e7d8dff42a8e/ubiquity-dollar/packages/contracts/test/diamond/facets/AccessControlFacet.t.sol , could we please get feedback from the Watson who submitted this issue directly or from the @AuditSea perhaps something was misunderstood here?

@rndquu
Copy link

rndquu commented Jan 17, 2024

this looks like an invalid because the admin can set new roles:

by "granting" its just the function its named grantRoles instead of set!

the submission claims that the Facet don't use it, the admin can indeed use it!

@rndquu @gitcoindev

This issue is about setting a role admin for some other role, not about granting roles.

Here is the setRoleAdmin() method which is missing in the AccessControlFacet contract. Should we want to set some role to be admin for another role we would need to upgrade the contracts by adding the setRoleAdmin() method to facets.

I would consider this valid and "will fix".

@molecula451
Copy link

good catch, yeah we missed the setRoleAdmin external function on the facet

@molecula451
Copy link

molecula451 commented Jan 19, 2024

PR Fix Confirmation: ubiquity/ubiquity-dollar#880 by @gitcoindev

@sherlock-admin2 sherlock-admin2 changed the title Macho Heather Mammoth - AccessControlFacet doesn't have ability to set admin for the role rvierdiiev - AccessControlFacet doesn't have ability to set admin for the role Jan 24, 2024
@sherlock-admin2 sherlock-admin2 added the Reward A payout will be made for this issue label Jan 24, 2024
@0xArz
Copy link

0xArz commented Jan 24, 2024

Escalate

I think this should be a low/qa as the impact here is not severe. There is no loss of funds and the roles can always be managed by the DEFAULT_ADMIN_ROLE which is set

@sherlock-admin2
Copy link
Contributor Author

Escalate

I think this should be a low/qa as the impact here is not severe. There is no loss of funds and the roles can always be managed by the DEFAULT_ADMIN_ROLE which is set

You've created a valid escalation!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

@sherlock-admin sherlock-admin added the Escalated This issue contains a pending escalation label Jan 24, 2024
@nevillehuang
Copy link
Collaborator

nevillehuang commented Jan 24, 2024

@0xArz you might want to reconsider you escalation based on this comment here. Based on sherlock medium severity rules, This breaks intended contract functionality, so it will likely be warranted medium severity even if there is no loss of funds

@molecula451
Copy link

We fixed this one check: #90 (comment)

@molecula451
Copy link

we will leave it as a medium

@0xArz
Copy link

0xArz commented Jan 24, 2024

@0xArz you might want to reconsider you escalation based on this comment here. Based on sherlock medium severity rules, This breaks intended contract functionality, so it will likely be warranted medium severity even if there is no loss of funds

I get that yeah but it doesnt break intended contract functionality if the admin of all roles is the DEFAULT_ADMIN_ROLE which will always be able to manage the roles and no fix is needed. Having seperate admins to manage the roles would ofc be good but i believe this should be a low so i will keep my escalation.

Copy link

ubiquibot bot commented Feb 16, 2024

+ Evaluating results. Please wait...

@0x4007
Copy link
Contributor

0x4007 commented Feb 16, 2024

@molecula451 its the character length bug. I can try to push a workaround real quick.

@molecula451
Copy link

@pavlovcik go ahead

Copy link

ubiquibot bot commented Feb 16, 2024

# No linked pull requests to close

Copy link

ubiquibot bot commented Feb 17, 2024

+ Evaluating results. Please wait...

Copy link

ubiquibot bot commented Feb 17, 2024

[ 9 WXDAI ]

@pavlovcik
Contributions Overview
ViewContributionCountReward
IssueComment39
Conversation Incentives
CommentFormattingRelevanceReward
@molecula451 https://github.com/sherlock-audit/2023-12-ubiquity-...
1.2-1.2
> ```diff > ! action has an uncaught error > ```

I think th...

4.5

code:
  count: 2
  score: "2"
  words: 2
-4.5
@molecula451 its the character length bug. I can try to push a w...
3.3
li:
  count: 1
  score: "1"
  words: 8
-3.3

[ 12.6 WXDAI ]

@molecula451
Contributions Overview
ViewContributionCountReward
IssueComment812.6
Conversation Incentives
CommentFormattingRelevanceReward
this looks like an invalid because the admin can [set new roles]...
5.2
a:
  count: 1
  score: "1"
  words: 3
-5.2
good catch, yeah we missed the setRoleAdmin external function on...
1.2-1.2
PR Fix Confirmation: https://github.com/ubiquity/ubiquity-dollar...
1.3-1.3
We fixed this one check: https://github.com/sherlock-audit/2023-...
1.8-1.8
we will leave it as a medium...
0.7-0.7
> Would like to add that this is not a bug, it is missing admi...
1.4-1.4
@Evert0x can you reopen - reclose this one...
0.7-0.7
@pavlovcik go ahead...
0.3-0.3

[ 4.7 WXDAI ]

@gitcoindev
Contributions Overview
ViewContributionCountReward
IssueComment14.7
Conversation Incentives
CommentFormattingRelevanceReward
Granting roles is tested at https://github.com/sherlock-audit/20...
4.7-4.7

[ 11.3 WXDAI ]

@rndquu
Contributions Overview
ViewContributionCountReward
IssueComment111.3
Conversation Incentives
CommentFormattingRelevanceReward
> this looks like an invalid because the admin can [set new role...
11.3
a:
  count: 3
  score: "3"
  words: 5
code:
  count: 2
  score: "2"
  words: 2
-11.3

@0x4007
Copy link
Contributor

0x4007 commented Feb 17, 2024

In the future @molecula451 be sure to link a pull request for assignees to get their credit.

@molecula451
Copy link

i think we can do it again, the bot won't trigger for the comments? @pavlovcik

@molecula451 molecula451 reopened this Feb 17, 2024
@molecula451
Copy link

looks like gitcoindev PR comment did not hook here ubiquity/ubiquity-dollar#880 (comment)

Copy link

ubiquibot bot commented Feb 17, 2024

@gitcoindev the deadline is at 2024-02-18T12:03:12.950Z

Copy link

ubiquibot bot commented Feb 17, 2024

+ Evaluating results. Please wait...

Copy link

ubiquibot bot commented Feb 17, 2024

[ 10.7 WXDAI ]

@pavlovcik
Contributions Overview
ViewContributionCountReward
IssueComment410.7
Conversation Incentives
CommentFormattingRelevanceReward
@molecula451 https://github.com/sherlock-audit/2023-12-ubiquity-...
1.2-1.2
> ```diff > ! action has an uncaught error > ```

I think th...

4.5

code:
  count: 2
  score: "2"
  words: 2
-4.5
@molecula451 its the character length bug. I can try to push a w...
3.3
li:
  count: 1
  score: "1"
  words: 8
-3.3
In the future @molecula451 be sure to link a pull request for as...
1.7-1.7

[ 16.1 WXDAI ]

@molecula451
Contributions Overview
ViewContributionCountReward
IssueComment1016.1
Conversation Incentives
CommentFormattingRelevanceReward
this looks like an invalid because the admin can [set new roles]...
5.2
a:
  count: 1
  score: "1"
  words: 3
-5.2
good catch, yeah we missed the setRoleAdmin external function on...
1.2-1.2
PR Fix Confirmation: https://github.com/ubiquity/ubiquity-dollar...
1.3-1.3
We fixed this one check: https://github.com/sherlock-audit/2023-...
1.8-1.8
we will leave it as a medium...
0.7-0.7
> Would like to add that this is not a bug, it is missing admi...
1.4-1.4
@Evert0x can you reopen - reclose this one...
0.7-0.7
@pavlovcik go ahead...
0.3-0.3
i think we can do it again, the bot won't trigger for the commen...
1.6-1.6
looks like gitcoindev PR comment did not hook here https://githu...
1.9-1.9

[ 204.7 WXDAI ]

@gitcoindev
Contributions Overview
ViewContributionCountReward
IssueTask1.00200
IssueComment10
IssueComment14.7
Conversation Incentives
CommentFormattingRelevanceReward
Granting roles is tested at https://github.com/sherlock-audit/20...
---
Granting roles is tested at https://github.com/sherlock-audit/20...
4.7-4.7

[ 11.3 WXDAI ]

@rndquu
Contributions Overview
ViewContributionCountReward
IssueComment111.3
Conversation Incentives
CommentFormattingRelevanceReward
> this looks like an invalid because the admin can [set new role...
11.3
a:
  count: 3
  score: "3"
  words: 5
code:
  count: 2
  score: "2"
  words: 2
-11.3

@molecula451
Copy link

molecula451 commented Feb 17, 2024

yeah pavlovick it's not hooking cross-side PR comment, tested with different keywords @pavlovcik

@0x4007
Copy link
Contributor

0x4007 commented Feb 17, 2024

yeah pavlovick it's not hooking cross-side PR comment, tested with different keywords @pavlovcik

The pull request must be linked to this issue. It currently is not that's why the bot did not associate the conversation.

@sherlock-admin
Copy link
Contributor

The protocol team fixed this issue in PR/commit ubiquity/ubiquity-dollar#880.

@sherlock-admin2 sherlock-admin2 removed the Has Duplicates A valid issue with 1+ other issues describing the same vulnerability label Feb 20, 2024
@sherlock-admin
Copy link
Contributor

The Lead Senior Watson signed off on the fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Escalation Resolved This issue's escalations have been approved/rejected Non-Reward This issue will not receive a payout Price: 200 USD Priority: 1 (Normal) Sponsor Confirmed The sponsor acknowledged this issue is valid Time: <1 Day Will Fix The sponsor confirmed this issue will be fixed
Projects
None yet
Development

No branches or pull requests