# BridgeFacet's _executePortalTransfer ignores underlying token amount withdrawn from Aave pool

BridgeFacet accounts for full Aave withdrawal amount while withdraw() may return less, causing underlying token deficit and partial bridge insolvency.

- Payout: Audit contest
- Severity: medium
- Program: Connext
- Found by: hyh
- Disclosed: 2022-10-17
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-06-connext-findings/issues/181
- Library page: https://bugbountylibrary.com/r/c4%3A2022-06-connext%3AM-15
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error

**Target:** BridgeFacet._executePortalTransfer / Aave pool integration
**Root cause:** The return value of IAavePool.withdraw() (actual underlying withdrawn) is ignored; s.portalDebt is set to the full requested userAmount even when Aave only partially fulfills the withdrawal due to liquidity shortage.
**Steps:**
1. Call execute() -> _handleExecuteLiquidity() -> _executePortalTransfer()
2. mintUnbacked(adopted, userAmount, address(this)) mints atokens for full amount
3. IAavePool.withdraw(adopted, userAmount, address(this)) returns actual withdrawn amount, which may be less than userAmount if pool lacks liquidity
4. Return value is discarded; s.portalDebt[_transferId] = userAmount records full debt
5. Bridge now holds surplus atokens but deficit of underlying, causing partial insolvency and failed future transfers
**How found:** Code review of _executePortalTransfer noticed the withdraw() return value was unused, then cross-referenced Aave v3 Pool/SupplyLogic to confirm withdraw can return less than requested under liquidity shortage.
**Insight:** When integrating lending pools, always consume the return value of withdraw()/redeem() — Aave can partially fulfill withdrawals under liquidity shortage, so accounting on the requested amount silently desyncs atoken vs underlying balances.

