Platform: Code4rena
Start Date: 25/01/2023
Pot Size: $90,500 USDC
Total HM: 3
Participants: 26
Period: 9 days
Judge: GalloDaSballo
Id: 209
League: ETH
Rank: 23/26
Findings: 1
Award: $122.82
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: berndartmueller
Also found by: 0xA5DF, 0xSmartContract, HollaDieWaldfee, IllIllI, SleepingBugs, btk, chaduke, fs0c, hansfriese, nalus, rbserver, zzzitron
122.8177 USDC - $122.82
The caller.sol adds a functionality for a user to authorize other users to make a call on behalf on them. This is done by calling the authorize
function from the user who want’s to authorize other users with the address of the user they want to authorize as the parameter to the function.
Let’s say a user wants to authorize 2 users A and B to make calls on behalf of them. Both the users should be at same priviledge level and user A should not be able to unauthorize user B from its priviledge.
This vulnerability allows user A to perfrom such actions and unauthorize user B. This can also be used to unauthorize by front-running a legit transaction of user B.
Note: I’ve asked the team, and they consider this is not an issue, that’s why I am reported it as QA as it still feels like a priviledge issue to me and I am keeping this open to discussion.
Add the following lines in AddressDriver.t.sol
address internal user2 = address(1337); function testCanunauthorizeotherusers() public { vm.prank(user); caller.authorize(address(this)); vm.prank(user); caller.authorize(user2); bool resultfirst = caller.isAuthorized(user, user2); assertTrue(resultfirst, "is unauthorized"); bytes memory callData = abi.encodeWithSelector(caller.unauthorize.selector, user2); caller.callAs(user, address(caller), callData); bool resultsecond = caller.isAuthorized(user, user2); assertFalse(resultsecond, "is authorized"); }
Only allow necessary functions to be called by authorized users.
#0 - GalloDaSballo
2023-02-14T20:25:23Z
TODO
#1 - GalloDaSballo
2023-02-22T13:33:43Z
1L
#2 - GalloDaSballo
2023-02-24T10:35:37Z
2L from dups
3L
#3 - c4-judge
2023-02-24T10:55:40Z
GalloDaSballo marked the issue as grade-b
#4 - GalloDaSballo
2023-03-02T08:31:45Z
Have re-checked and confirm QA as distinct from the Med finding which talks about maintaining authorization vs removing it