The TransferProxy.sol is important because it helps with moving the fund around in AuctionHouse, AstariaRouter and in LienToken.
As we can see, this function below is powerful. It is likely that user will give the max token allowance to the contract TransferProxy, otherwise, transaction would revert in AuctionHouse.sol, LienToken and in AuctionHouse.
Well, note that the requiresAuth modifier is used in the function tokenTransferFrom, this access control model means that only specific address set up by admin can call this function.
If the admin is compromised, the admin can authorize malicious contract that can drain all the token fund from user by calling the above tokenTransferFrom after user gives token allowance to TransferProxy.sol
Because the requiresAuth modifier calls:
which calls:
The auth.canCall is called in MultiRolesAuthority.sol, as shown in the Deploy.sol script
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/scripts/deployments/Deploy.sol#L118
And the relevent authorization is granted by calling:
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/scripts/deployments/Deploy.sol#L377
and
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/scripts/deployments/Deploy.sol#L410
by calling:
A compromised admin can call:
and
Then the malicious_contract_or_account address has permission to call tokenTransferFrom, which drains user token after user gives token allowance to TransferProxy.sol. All he needs to do is set the token to token that he wants to transfer and steal, the address from is victims address, the address to is the recipient (hackers address), the amount is how much he wants to transfer and drain.
The reference (relevant )code for MultiRolesAuthority in solmate:
https://github.com/transmissions11/solmate/blob/main/src/test/MultiRolesAuthority.t.sol
Only use safeIncreaseAllowance to give minimum approval to move the fund around, use multisig to safeguard to admin.
SantiagoGregory (Astaria) disputed and commented:
androolloyd (Astaria) disputed and commented:
SantiagoGregory (Astaria) disputed and commented:
SantiagoGregory (Astaria) disagreed with severity and commented:
androolloyd (Astaria) commented:
SantiagoGregory (Astaria) commented:
androolloyd (Astaria) commented:
Picodes (judge) commented:
For this audit, 28 reports were submitted by wardens detailing gas optimizations. The report highlighted below by c3phas received the top score from the judge.
The following wardens also submitted reports: CloudX, Aymen0909, 0xAgro, IllIllI, ReyAdmirado, pfapostol, synackrst, Rageur, 0xackermann, PaludoX0, kaden, fs0c, caventa, SadBase, nogo, 0xSmartContract, shark, fatherOfBlocks, 0xkato, 0x1f8b, Rolezn, chrisdior4, RaymondFam, chaduke, SaeedAlipoor01988, Bnke0x0, and Rahoz.
