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

YetiFinanceTreasury.sol#updateTeamWallet() should implement two-step transfer pattern #251

Open
code423n4 opened this issue Dec 22, 2021 · 2 comments
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working

Comments

@code423n4
Copy link
Contributor

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/YetiFinanceTreasury.sol#L28-L30

function updateTeamWallet(address _newTeamWallet) external onlyTeam {
    teamWallet = _newTeamWallet;
}

YetiFinanceTreasury.teamWallet is a critical role, if the current teamWallet mistakenly called updateTeamWallet() with a wrong address, it can result in all the onlyTeam() methods being unaccessible, and it cannot be undo.

Recomandation

Consider changing the updateTeamWallet() function to first nominate an address as the pending teamWallet and adding an acceptTeamWallet() function which is called by the pending teamWallet to confirm the transfer.

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Dec 22, 2021
code423n4 added a commit that referenced this issue Dec 22, 2021
@kingyetifinance kingyetifinance added the duplicate This issue or pull request already exists label Jan 5, 2022
@kingyetifinance
Copy link
Collaborator

@LilYeti: Duplicate #115

@alcueca alcueca removed the duplicate This issue or pull request already exists label Jan 15, 2022
@alcueca
Copy link
Collaborator

alcueca commented Jan 15, 2022

Taking this as main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants