This vulnerability is in the Adminable.sol
contract, which is in charge of access control and transfer of ownership. It is possible that the initial admin transfers the ownership of the contract to an incorrect account. In that case, the team will lose access to the priviledged functions of Sablier Stream.
This is the only function in the Adminable.sol
contract:
newAdmin
is intended to be the address of the new owner. Now, there will be a problem when the current owner put inputs an unintended address as newAdmin
.
If this is done, the unintended entity will be the new admin, and the team will lose access to it!
I am aware the first waiver to this might be, "this is due to human error." Yes, because in reality, human errors are bound to happen.
The best thing to do from a security PoV is to check against human errors so the code can be safe. OpenZeppelin had to create Ownable2Step because of this.
These are the impact of this vulnerability:
the team will lose control of the contracts that use Adminable.sol
and not be able to call their privileged functions
the unintended entity can exploit the Stream at will!
Imagine the control of the contract is intended to be transferred to address(0x1234)
But access is unintentionally sent to address(0x12345)
address(0x12345)
becomes the new owner
address(0x12345)
can exploit the contracts inheriting Adminable.sol
Create a file and name it admin.t.sol
and paste this:
When you run this test, this should show on CLI; meaning it passed.
Adminable.sol
is an abstract contract, so I wrote TestAdminable
as a contract to instantiate it.
The intended entity to be the new owner is address(0x1234)
but the initial admin erroneously made address(0x12345)
the new admin.
Now, the wrongPerson
is in charge of the contract!
Foundry
The OZ team created Ownable2Step for this reason.
Use this library or implement it locally in Adminable.sol
. Then this vulnerability can be blocked.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.