SmartAccount execTransaction can be run by anyone due to a missing signer check when using EIP1271 signatures #62
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-175
satisfactory
satisfies C4 submission criteria; eligible for awards
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-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L314-L343
Vulnerability details
Impact
Anyone using the
SmartAccount
contract to host a 1/1 multisig may have their multisig operated by an attacker using a specially crafted signature. This would result in total loss from theSmartAccount
and any contracts allowing theSmartAccount
to perform privileged actions.Proof of Concept
The issue can be reproduced using the following steps:
testContract.address
)execTransaction
against the victim'sSmartAccount
for a transaction that transfers all the contract's native currency and coins using the following signature (represented as it would be in a Hardhat test):This decodes to:
r = uint256(testContract.address), s = uint256(65), v = uint8(0), (signature + s) -> bytes("")
Additionally, some Hardhat code has been provided to demonstrate the issue:
Tools Used
Detection - Manual Review
Demonstration - Hardhat
Recommended Mitigation Steps
To resolve the issue, the SmartAccount contract should either:
The text was updated successfully, but these errors were encountered: