Platform: Code4rena
Start Date: 21/07/2023
Pot Size: $90,500 USDC
Total HM: 8
Participants: 60
Period: 7 days
Judge: 0xean
Total Solo HM: 2
Id: 264
League: ETH
Rank: 47/60
Findings: 2
Award: $194.68
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: LaScaloneta
Also found by: 0xComfyCat, 0xDING99YA, 0xnev, ABA, BugBusters, DadeKuma, MohammedRizwan, QiuhaoLi, Sathish9098, Udsen, ak1, bart1e, immeas, koxuan, ladboy233, matrix_0wl, oakcobalt, squeaky_cactus, zhaojie
194.678 USDC - $194.68
https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L340
Detailed description of the impact of this finding.
To prevent the admin calling tokens' addresses directly and bypassing spending functions, we check if spendThresholds[targets[i]].small != 0 in the batchCalls():
function batchCalls( address[] memory targets, bytes[] calldata calldatas ) external onlyRole(ADMIN_ROLE) nonReentrant { if (targets.length != calldatas.length) revert T_ArrayLengthMismatch(); // execute a package of low level calls for (uint256 i = 0; i < targets.length; ++i) { if (spendThresholds[targets[i]].small != 0) revert T_InvalidTarget(targets[i]);
However, the check can be bypassed, e.g.:
Manual Review
An ad-hoc fix may be forbidding any token (including ones not set thresholds yet) contract calls. But in the long term, I think we should limit what admin can call with finer-grained functions and void this batchCalls funciton.
ERC20
#0 - 141345
2023-07-31T09:07:01Z
previlidged functions, and the proposal needs to go through vote. Quite difficult to meet both.
#1 - c4-sponsor
2023-08-04T14:15:30Z
PowVT marked the issue as sponsor acknowledged
#2 - PowVT
2023-08-04T14:17:38Z
This would have to pass through a governance vote and pass the timelock waiting period to be executed. The intention at launch is that high value and prominent tokens will have their initial thresholds set at launch before the treasury is handed over to governance. This way the thresholds are already in place and scenarios like this one will be blocked.
#3 - c4-judge
2023-08-10T20:11:07Z
0xean changed the severity to QA (Quality Assurance)
#4 - 0xean
2023-08-10T23:09:01Z
Using this issue to score all of wardens findings that have been marked as QA
#5 - c4-judge
2023-08-10T23:09:44Z
0xean marked the issue as grade-a