VirtualAccount cannot directly send native tokens #307
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
edited-by-warden
M-32
primary issue
Highest quality submission among a set of duplicates
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/VirtualAccount.sol#L41-L53
Vulnerability details
Impact
Certain functions require native tokens to be sent. These functions will revert.
Proof of Concept
According to the Sponsor, VirtualAccounts can "call any of the dApps present in the Root Chain (Arbitrum) e.g. Maia, Hermes, Ulysses AMM,Uniswap." However, this is not the case as
call()
is notpayable
and thus cannot send native tokens to other contracts. This is problematic because certain functions require native token transfers and will fail.Tools Used
Manual
Recommended Mitigation Steps
Consider creating a single
call()
function that has apayable
modifier and{value: msg.value}
. Be aware that sincecalls[i].target.call()
is in a loop, it is not advisable to add payable to the existingcall()
. This is becausemsg.value
may be used multiple times, and is unsafe.Assessed type
Payable
The text was updated successfully, but these errors were encountered: