Submitted by TrungOre
https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/CdpManager.sol#L434-L443 
https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/CdpManager.sol#L209-L214
The CdpManager.redeemCollateral() function is used to send the _debt amount of EBTC to the system and redeem the corresponding amount of stETH. There are two important features to note about this function before delving into the problem:
The protocol utilizes a new technique by employing a sortedCdps.batchRemove() function to remove a consecutive sequence of Cdps in the sorted list after the redemption loop, instead of removing each one individually in each iteration of the loop for gas-saving purposes.
As we observe, in each iteration of the loop, the internal function CdpManager._redeemCollateralFromCdp() is triggered, executing the following logic:
The flaw arises when the partially redeemed Cdp is reinserted while the fully redeemed Cdps havent been removed from the sorted list yet.
Note: please see scenario in wardens original submission.
The sequence of the sortedCdps list will be disrupted, and given that essential protocol functions operate in accordance with this sequence, the severity of the issue is significant.
Instead of inserting the partially redeemed Cdp back in the for-loop, the function should reinsert it after removing the fully redeemed Cdp.
Alex the Entreprenerd (Badger) disputed and commented:
rayeaster (Badger) commented:
ronnyx2017 (Judge) commented:
Alex the Entreprenerd (Badger) commented:
ronnyx2017 (Judge) commented:
CodingNameKiki (Warden) commented:
ronnyx2017 (Judge) decreased severity to Low/Non-critical and commented:
WelToHackerLand (Warden) commented:
CodingNameKiki (Warden) commented:
huuducsc (Warden) commented:
CodingNameKiki (Warden) commented:
ronnyx2017 (Judge) increased severity to Medium and commented:
Note: For further discussion, see here.
