Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix executeRecovery re-entrancy #31

Merged
merged 1 commit into from
Dec 12, 2022
Merged

Fix executeRecovery re-entrancy #31

merged 1 commit into from
Dec 12, 2022

Conversation

k1rill-fedoseev
Copy link
Collaborator

@k1rill-fedoseev k1rill-fedoseev commented Dec 6, 2022

The executeRecovery function in ERC20Recovery can only be called by the owner or the recovery admin. When recovering the tokens, they are transferred to the recoveredFundsReceiver address. If this address is a contract, the onTokenTransfer function is called. This call could be used to reenter the executeRecovery function in order to double-claim the funds to recover. This would allow the recovery admin or the owner to exceed the intended recoveryLimit.

Comments to changes:
The order of storage writings for recovery execution flow was changes, so that the are now executed before respected receiver callback.

@k1rill-fedoseev k1rill-fedoseev self-assigned this Dec 6, 2022
@akolotov akolotov merged commit e12e6fd into master Dec 12, 2022
@akolotov akolotov deleted the audit/dec22/5.1 branch December 12, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants