Platform: Code4rena
Start Date: 22/09/2023
Pot Size: $100,000 USDC
Total HM: 15
Participants: 175
Period: 14 days
Judge: alcueca
Total Solo HM: 4
Id: 287
League: ETH
Rank: 105/175
Findings: 1
Award: $25.68
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: MrPotatoMagic
Also found by: 0xAadi, 0xDING99YA, 0xDemon, 0xRstStn, 0xSmartContract, 0xStriker, 0xWaitress, 0xbrett8571, 0xfuje, 0xsagetony, 0xsurena, 33BYTEZZZ, 3docSec, 7ashraf, ABA, ABAIKUNANBAEV, Aamir, Audinarey, Bauchibred, Black_Box_DD, Daniel526, DanielArmstrong, DanielTan_MetaTrust, Dinesh11G, Eurovickk, Franklin, Inspecktor, John, Jorgect, Joshuajee, K42, Kek, Koolex, LokiThe5th, MIQUINHO, Myd, NoTechBG, QiuhaoLi, SanketKogekar, Sathish9098, Sentry, Soul22, SovaSlava, Stormreckson, Tendency, Topmark, Udsen, V1235816, Viktor_Cortess, Viraz, Yanchuan, ZdravkoHr, Zims, albahaca, albertwh1te, alexweb3, alexxander, ast3ros, audityourcontracts, bareli, bin2chen, bronze_pickaxe, c0pp3rscr3w3r, cartlex_, castle_chain, chaduke, debo, ether_sky, gumgumzum, imare, its_basu, jaraxxus, jasonxiale, josephdara, kodyvim, ladboy233, lanrebayode77, lsaudit, mert_eren, minhtrng, n1punp, nadin, niroh, nmirchev8, orion, peakbolt, perseverancesuccess, pfapostol, ptsanev, rvierdiiev, saneryee, shaflow2, te_aut, terrancrypt, twcctop, unsafesol, ustas, versiyonbir, windhustler, yongskiws, zhaojie, ziyou-
25.6785 USDC - $25.68
MulticallRootRouter, appears to have a potential vulnerability related to account existence checks for low-level calls. The vulnerability may exist in the following functions:
// In _approveAndCallOut outputToken.safeApprove(_bridgeAgentAddress, amountOut); IBridgeAgent(_bridgeAgentAddress).callOutAndBridge{value: msg.value}( payable(refundee), recipient, dstChainId, "", SettlementInput(outputToken, amountOut, depositOut), gasParams, true ); // In _approveMultipleAndCallOut for (uint256 i = 0; i < outputTokens.length;) { outputTokens[i].safeApprove(_bridgeAgentAddress, amountsOut[i]); unchecked { ++i; } } IBridgeAgent(_bridgeAgentAddress).callOutAndBridgeMultiple{value: msg.value}( payable(refundee), recipient, dstChainId, "", SettlementMultipleInput(outputTokens, amountsOut, depositsOut), gasParams, true );
In both functions, the contract directly interacts with external addresses (recipient and _bridgeAgentAddress) without confirming if they are valid and exist. This could lead to potential issues such as:
// In _approveAndCallOut require(recipient != address(0), "Invalid recipient address"); require(_bridgeAgentAddress != address(0), "Invalid bridge agent address"); outputToken.safeApprove(_bridgeAgentAddress, amountOut); IBridgeAgent(_bridgeAgentAddress).callOutAndBridge{value: msg.value}( payable(refundee), recipient, dstChainId, "", SettlementInput(outputToken, amountOut, depositOut), gasParams, true ); // In _approveMultipleAndCallOut require(recipient != address(0), "Invalid recipient address"); require(_bridgeAgentAddress != address(0), "Invalid bridge agent address"); for (uint256 i = 0; i < outputTokens.length;) { outputTokens[i].safeApprove(_bridgeAgentAddress, amountsOut[i]); unchecked { ++i; } } IBridgeAgent(_bridgeAgentAddress).callOutAndBridgeMultiple{value: msg.value}( payable(refundee), recipient, dstChainId, "", SettlementMultipleInput(outputTokens, amountsOut, depositsOut), gasParams, true );
By adding these checks, you can ensure that the contract interacts only with valid and existing addresses, reducing the risk of potential vulnerabilities related to account existence.
call/delegatecall
#0 - c4-pre-sort
2023-10-09T07:35:10Z
0xA5DF marked the issue as low quality report
#1 - 0xA5DF
2023-10-09T07:36:10Z
Adding more checks can be a QA, in order to qualify as H/M warden has to prove there's a practical scenario of damage to the protocol
#2 - c4-judge
2023-10-23T09:37:49Z
alcueca changed the severity to QA (Quality Assurance)
#3 - c4-judge
2023-10-23T09:37:59Z
alcueca marked the issue as grade-a