Submitted by 0xpiken, also found by 0xlemon, klau5, klau5, MrPotatoMagic, and shaflow2
https://github.com/code-423n4/2024-12-bakerfi/blob/main/contracts/core/strategies/StrategySupplyERC4626.sol#L44
https://github.com/code-423n4/2024-12-bakerfi/blob/main/contracts/core/strategies/StrategySupplyERC4626.sol#L51
https://github.com/code-423n4/2024-12-bakerfi/blob/main/contracts/core/strategies/StrategySupplyERC4626.sol#L58
The _deploy(), _undeploy(), and _getBalance() functions of StrategySupplyERC4626 currently return the amount of shares instead of the amount of the underlying asset. This mistake leads to incorrect calculations of user assets within any BakerFi Vault that utilizes StrategySupplyERC4626.
When a user deposits a certain amount of asset (deployedAmount) into a BakerFi vault, it is deployed into the vaults underlying strategies. In return, the user receives a corresponding number of shares:
To withdraw their deployed assets from a BakerFi vault, users must burn a corresponding number of shares to receive a certain amount of assets:
As we can see, the return values of _deploy() and _undeploy() should represent the amount of asset. In addition, _totalAssets() should also return the amount of asset.
The implementation of the above functions within the Vault contract is as follows:
It is obvious that the return value should represent the amount of assets when _strategy.deploy(), _strategy.undeploy() or _strategy.totalAssets() is called.
However, the functions in StrategySupplyERC4626 mistakenly return the number of shares other than the amount of underlying asset:
This issue could lead to a scenario where a portion of user assets are permanently locked within the BakerFi vault.
Create ERC4626Mock contract with below codes: 
Create StrategySupplyERC4626.ts with below codes and run npm run test:
As we can see that only 5e18 WETH can be withdrawn within 10e18 WETH deployed. The rest 5e18 WETH are permanently locked within the BakerFi vault. The amount of locked asset can be calculated as below:
Note: please see scenario in wardens original submission.
Update StrategySupplyERC4626 to return correct value:
chefkenji (BakerFi) confirmed
BakerFi mitigated:
Status: Mitigation confirmed. Full details in reports from shaflow2 and 0xlemon.
