An admin authority initializing RebateInfo will make claim_rebate_fee unusable
A constraint in the claim_rebate_fee instruction requires the rebate_info authority to equal the rebate_manager authority, which is false when an admin authority initialised the rebate_info. This prevents the rebate authority from claiming their rebate fee, causing a 100% loss of those fees.
Source: https://github.com/sherlock-audit/2024-08-woofi-solana-deployment-judging/issues/13
Found by
Albort, D1r3Wolf, g, zigtur
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
- An admin authority needs to initialize the
rebate_infothrough thecreate_rebate_infoinstruction. It is made possible through the constraint atcreate_rebate_info.rs#L17.
External pre-conditions
None.
Attack Path
No response
Impact
- The rebate authority suffers from 100% rebate fee loss as it is not able to claim (through the
claim_rebate_feeinstruction).
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.
Discussion
toprince
Need further investigation.
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/woonetwork/WOOFi_Solana/pull/28
gjaldon
Issue is fixed. This change fixes the issue by also allowing admin authorities to claim rebate fees.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an incorrect equality constraint in claim_rebate_fee that does not account for rebate_info being initialised by an admin authority.
Impact
The rebate authority suffers a 100% loss of rebate fees because they cannot claim them.
What the attacker needed
Admin authority initialises rebate_info
The fix
The constraint should be deleted, or the fix should also allow admin authorities to claim rebate fees.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In this Solana program, a rebate manager holds funds that a rebate authority can claim. The claim function checks that the rebate info's authority matches the rebate manager's authority, but if an admin set up the rebate info, those authorities differ, so the check always fails and the rebate authority can never claim their fees.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.