<!-- canonical: https://0xsimao.com/findings/yieldoor-iii-debt-stuck-aave-morpho -->

# It's possible for debt to be stuck in the LoopedVault when rebalancing from Aave to Morpho

Low/Info · 0xSimao · Leveraged yield farming · 23rd June 2025

Finding L-2 of the Yieldoor LoopedVault Update security review.

- Protocol: https://app.yieldoor.com/
- Report: /reports/yieldoor-iii
- Source: https://github.com/0xSimao/audits/blob/main/0xSimao/2025-06-23-yieldoor-iii.pdf

---

**Description:**

`RebalanceLogic::aaveToMorpho()` borrows from Morpho and repays Aave debt. If trying to [repay](https://github.com/spacegliderrrr/loopedVault/blob/master/src/libraries/RebalanceLogic.sol#L163) more Aave debt than the available, the function will go through but borrow tokens will be left in the `LoopedVault`. This is not an issue in case the borrow token is $USDC, the asset of the vault, as it is accounted for as `LoopedVault::idleBalance()`. However, if the borrowed token is for example $DAI, it will not be accounted for and cause issues.

**Recommended Mitigation:**

Revert if trying to repay more debt than the available (default Morpho behaviour).

---

Related findings:

- [RebalanceLogic::rebalanceCallback() doesn't update lastTotalAssets when rebalancing from morpho to morpho](https://0xsimao.com/findings/yieldoor-ii-rebalance-callback-rebalancing-morpho): Yieldoor LoopedVault
- [REBALANCER_ROLE can drain funds by rebalancing in a loop in the BorrowingVault](https://0xsimao.com/findings/fuji-finance-rebalancer-drain-rebalancing-loop): Fuji Finance
- [Unhandled request invalidation by the owner of Etherfi will lead to stuck debt](https://0xsimao.com/findings/benddao-unhandled-invalidation-stuck-debt): BendDAO
- [Admin new issuance or user calling `Vault::redeemExpiredLv()` after `Psm::redeemWithCt()` will lead to stuck funds when trying to withdraw](https://0xsimao.com/findings/cork-protocol-issuance-redeem-stuck-withdraw): Cork Protocol
