Submitted by WatchPug, also found by IllIllI
TimeswapPair.sol#L459-L490
At L484, if there is only one id, and for the first and only time of the for loop, assetIn and collateralOut will be 0, therefore require(uint256(assetIn) * due.collateral >= uint256(collateralOut) * due.debt, 'E303'); will pass.
A attacker can call pay() with param.assetsIn[0] == 0 and param.collateralsOut[i] == due.collateral.
The attacker can:
As a result, the attacker effectively stole 10,000 USDC.
Change to:
Mathepreneur (Timeswap) resolved and commented:
0xleastwood (judge) commented:
