Uninitialized feeRecipient in Leverager.sol
The Leverager contract's feeRecipient variable is never initialised and has no setter, so when liquidatePosition sends fees they go to the zero address. This causes a loss of protocol fees.
Source: https://github.com/sherlock-audit/2025-02-yieldoor-judging/issues/642
Found by
Bushman, Drynooo, Josh4324, KrisRenZo, Matic68, Nomadic_bear, SarveshLimaye, Victor_TheOracle, _0memgboji, godwinudo, kom, m3dython, montecristo, nganhg, stuart_the_minion, surenyan-oks
Summary
In the Leverager contract, the feeRecipient variable is not initialized and there is no setter function to set it. This is problematic because the liquidatePosition send funds to the feeRecipient.
https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/Leverager.sol#L47 https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/Leverager.sol#L299
Root Cause
The feeRecipient is not initialized in the constructor, and there is no function to set it after the contract has been deployed.
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
None
Impact
Funds to the feeRecipient when the liquidatePosition is called will be sent to address 0, there is a loss of protocol fees.
PoC
None
Mitigation
Initialize feeRecipient in the constructor and create a function to change the feeRecipient in the future.
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
The feeRecipient state variable is left uninitialised in the constructor and no setter function exists to assign it later.
Impact
Protocol fees that should go to feeRecipient during liquidation are sent to the zero address, resulting in a loss of those fees.
What the attacker needed
None
The fix
Initialise feeRecipient in the constructor and add a function to update it in the future.
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.
A smart contract has a variable meant to hold the address that receives fees. Because the contract never sets this address when it is created, and offers no way to change it later, the address stays empty (the zero address). Any fees sent there are lost forever.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.