Open sherlock-admin4 opened 1 month ago
Any one can deploy a contract and gain owner authority. Like anyone can deploy a new coin called itself USDT... You can already create a rebate manager now. But we will not use that. So not see pre create is a issue...
The protocol team fixed this issue in the following PRs/commits: https://github.com/woonetwork/WOOFi_Solana/pull/45
zigtur
Medium
Any user will gain authority on RebateManager
Summary
A
create_rebate_manager
transaction from the protocol can be front-run by anyone to gain authority over aRebateManager
.Root Cause
create_rebate_manager.rs#L11-L12
, theauthority
signer is not checked to ensure it is a trusted address.create_rebate_manager.rs#L14-L23
, the initialization of aRebateManager
is based on "first come, first served"create_rebate_manager.rs#L14-L23
, theRebaseManager
PDA is derived from thequote_token_mint
public key. We know that project will support USDT, USDC and SOL so these parameters are known.Internal pre-conditions
RebateManager
associated to the given token must not have been initializedExternal pre-conditions
No response
Attack Path
create_rebase_instruction
before the project, with a token address that the project aims to support (USDT, USDC, SOL).Impact
PoC
No response
Mitigation
The program should set an access control check on the
create_rebase_manager
instruction to ensure that the signer (authority
) is trusted.