sherlock-audit / 2024-08-woofi-solana-deployment-judging

2 stars 2 forks source link

zigtur - Any user will gain authority on RebateManager #14

Open sherlock-admin4 opened 1 month ago

sherlock-admin4 commented 1 month ago

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 a RebateManager.

Root Cause

Internal pre-conditions

External pre-conditions

No response

Attack Path

  1. User calls 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.

toprince commented 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...

sherlock-admin2 commented 3 weeks ago

The protocol team fixed this issue in the following PRs/commits: https://github.com/woonetwork/WOOFi_Solana/pull/45

gjaldon commented 2 weeks ago

This change fixes the issue by including the signer's key in the seeds for the rebate manager. Each signer will now create a different rebate manager and attackers can no longer control the single global rebate manager.