All reallocate cross-chain token and rewards will be lost for the users using the account abstraction wallet
The Nudge campaign contract sends cross-chain reallocated tokens and rewards to the same address used on the source chain, but account abstraction wallets have different addresses on each chain. An attacker could cause users to lose their reallocated tokens and permanently lock their rewards.
0xDemon Follow with Mike_Bello90
Originally disclosed on Code4rena
Submitted by 0xDemon, also found by Mike_Bello90
Finding description and impact
Users with account abstraction wallets have a different address across different chains for same account, so if user using an account abstraction wallet initiate reallocate cross-chain token, the toToken will be sent to wrong address and lost permanently.
With 6.4 million users and 100+ billion assets, there is very high risk that safe wallet users will try to initiate cross-chain reallocations and suffering a loss
In addition, there are other impacts, the user cannot claim rewards on the destination chain and the rewards for that user end up being locked forever in the NugeCampaign.sol contract because no one can’t rescue the reward token even with rescueTokens() and withdrawRewards() functions.
Proof of Concept
Based on the Nudge docs and Lifi SDK, the user flow for cross-chain reallocation is seen below:
- Alice connect her ethereum mainnet address on Nudge campaign website.
- Alice initiate cross-chain reallocation for reallocate
100 ETHfrom Ethereum mainnet to200_000 USDCon Base. - After LiFi performed swap, then it call
handleReallocation()with these params:
function handleReallocation(
uint256 campaignId_,
address userAddress,
address toToken,
uint256 toAmount,
bytes memory data
) external payable whenNotPaused {
- The
userAddressparam will be filled by the ethereum mainnet address owned by Alice. - Then
200_000 USDCwill be sent to that address via the_transfer()function.
_transfer(toToken, userAddress, amountReceived);
function _transfer(address token, address to, uint256 amount) internal {
if (token == NATIVE_TOKEN) {
(bool sent, ) = to.call{value: amount}("");
if (!sent) revert NativeTokenTransferFailed();
} else {
SafeERC20.safeTransfer(IERC20(token), to, amount);
}
}
- After that, reward will be calculated and stored in the
Participationstruct:
participations[pID] = Participation({
status: ParticipationStatus.PARTICIPATING,
userAddress: userAddress,
toAmount: amountReceived,
rewardAmount: userRewards,
startTimestamp: block.timestamp,
startBlockNumber: block.number
});
- Users can claim rewards by calling
claimRewards()and entering the pID in theParticipationstruct.
Let’s breakdown how users can loss all reallocated cross-chain tokens and the rewards:
- Cross-chain reallocates token
It can be seen in step 5, toToken amount or in this example is 200_000 USDC will be transferred to userAddress. The main problem arises here, because as explained the abstraction wallet account has a different address across chains. Thus, the toToken amount will be transferred to the address at userAddress which may not be the address owned by Alice and Alice will lose all reallocated tokens.
And also keep in mind, on current implementation on the Nudge website, there is no option for users to enter the recipient address on the destination chain when performing cross-chain reallocations. Not even in the existing docs. This proves that the Nudge protocol is not aware of this issue.
- The rewards
User can claim rewards by calling claimRewards(). One of the checks in this function is whether msg.sender is the same as the userAddress in the participation struct:
// Verify that caller is the participation address
if (participation.userAddress != msg.sender) {
revert UnauthorizedCaller(pIDs[i]);
}
The main problem arises here, because as explained the abstraction wallet account has a different address across chain. This means Alice cannot claim her reward on the Base chain because the address it has on the Base chain (as msg.sender) is different from the address on ethereum mainnet chain (as participation.userAddress).
Note:
- This issue not only affects regular campaigns but also
NudgePointCampaign.- This issue is similar and inspired by this valid issue.
Recommended mitigation steps
Give the user the option to pass in the address. The tokens should be transferred on the destination chain. Pass in the warning for account abstraction wallet holders to not to pass the same wallet address when initiate cross-chain reallocations.
raphael (Nudge.xyz) confirmed
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract assumes the same address across chains and does not let the user specify a destination address, so transfers and reward claims use the source-chain address.
Impact
Users with account abstraction wallets could permanently lose reallocated tokens and their rewards could be locked forever, though the report does not demonstrate an exploit against a live system.
What the attacker needed
User has an account abstraction wallet; user initiates a cross-chain reallocation; no destination address option exists
The fix
The contract should let the user provide a destination address and warn account abstraction wallet users not to reuse the same address across chains.
How it was found
- Alice connects her Ethereum mainnet address on the Nudge campaign website.
- Alice initiates a cross-chain reallocation from Ethereum mainnet to Base.
- LiFi performs the swap and calls handleReallocation with Alice's Ethereum address as userAddress.
- The contract transfers the destination token to that userAddress on Base.
- The reward is stored with the same userAddress.
- Alice cannot claim the reward on Base because her Base address differs from the stored userAddress.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
An account abstraction wallet is a smart contract wallet that can have a different address on each blockchain. This report says that when a user moves tokens from one chain to another, the system sends the tokens to the address from the first chain, which may not belong to the user on the second chain, so the tokens are lost. Rewards are also locked because the user cannot prove ownership from the different address.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.