Submitted by oakcobalt
In Pool.sol, queueClaimAll flow will transfer received funds (returned funds from loans) for each queue to newer queues.
Received funds for a given queue are intended to be distributed to newer queues:
This logic is implemented in _updatePendingWithdrawalWithQueue(). Due to queue arrays are circular, the array index never exceeds getMaxTotalWithdrawalQueues and will restart from 0.
% totalQueues should be used when checking array indexes in most cases. However, in the queue index for-loop, if (secondIdx == _cachedPendingQueueIndex + 1) {break;} is used to break the loop instead of secondIdx == (_cachedPendingQueueIndex + 1)%totalQueues.
This is problematic in some cases:
Based on my understanding, this should be if (i0 && secondIdx == (_cachedPendingQueueIndex + 1)%totalQueues) { break;}
Error
0xA5DF (judge) commented:
0xend (Gondi) confirmed and commented:
0xA5DF (judge) increased severity to High
Gondi mitigated:
Status: Mitigation confirmed. Full details in reports from oakcobalt, minhquanym and bin2chen.
