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

0 stars 0 forks source link

Cuddly Gauze Mustang - An admin authority initializing RebateInfo will make claim_rebate_fee unusable #13

Open sherlock-admin3 opened 15 hours ago

sherlock-admin3 commented 15 hours ago

Cuddly Gauze Mustang

High

An admin authority initializing RebateInfo will make claim_rebate_fee unusable

Summary

A ClaimRebateFee constraint enforces that rebate_info.authority == rebate_manager.authority. This will always be false when an admin authority initialized the rebate_info, leading the rebate_info.rebate_authority to not be able to claim their rebate fee.

Root Cause

In claim_rebate_fee.rs:26, there is an incorrect constraint.

Internal pre-conditions

  1. An admin authority needs to initialize the rebate_info through the create_rebate_info instruction. It is made possible through the constraint at create_rebate_info.rs#L17.

External pre-conditions

None.

Attack Path

No response

Impact

PoC

No response

Mitigation

This constraint should be deleted. Fixing it to check if the rebate_info.authority is an admin authority will lead to the same issue being triggered when admin authorities are updated.

toprince commented 13 hours ago

Need further investigation.