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

[TOB-BOB-2] Lack of two-step process for owner transference #3

Open
technovision99 opened this issue Apr 12, 2024 · 0 comments
Open

Comments

@technovision99
Copy link

Lack of two-step process for owner transference

Severity: Low
Difficulty: High
Type: Data Validation
Target: src/FusionLock.sol

Description

When called, the transferOwnership function immediately sets the contract owner to a new address. The use of a single step to make such a critical change is error-prone; if the function is called with erroneous input, the results could be irrevocable or difficult to recover from.

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/01ef448981be9d20ca85f2faf6ebdf591ce409f3/contracts/access/Ownable.sol#L84-L99

Exploit Scenario
Alice invokes the transferOwnership function to change the contract administrator but accidentally enters the wrong address. She permanently loses access to the contract.

Recommendations
Short term, implement a two-step process for all irrecoverable critical operations. Consider using Ownable2Step instead of Ownable.
Long term, improve unit testing to uncover edge cases and ensure intended behavior throughout the system.

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

No branches or pull requests

1 participant