Recovery spells don't allow the addition or removal of owners, potentially leading to the compromisation of the wallet #16
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
nullified
Issue is high quality, but not accepted
primary issue
Highest quality submission among a set of duplicates
🤖_36_group
AI based duplicate group recommendation
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-10-kleidi/blob/main/src/RecoverySpell.sol#L165-L317
Vulnerability details
Description
When recovery spells are created, users preset the new owners of the safe that will be swapped. This is set at the wallet creation time, as the owners used will be part of the creation salt that is used to compute the recovery spell address. Recovery spells don't allow users to remove or add owners to that list.
In case 1 of the "new owners" is compromised and the recovery spell is used, that compromised owner will be injected as an owner in the safe's owners list, knowing that the previous owners are aware of this compromisation but had no solution to solve it.
This leads to the full compromisation of a wallet.
Proof of Concept
AddressCalculation::calculateAddress
.At this point we assume both users B and D are compromised
executeRecovery
on the created spell, however, the issue here is that the new owners that will be replaced contain a compromised owner which is D.This results in a messed-up wallet, where a compromised owner is forcefully injected into the safe. As users before knew it was compromised but couldn't remove it.
Recommended Mitigation Steps
Allow users to add/remove recovery spell owners, which can be done by other owners signing that transaction.
Assessed type
Error
The text was updated successfully, but these errors were encountered: