In WithdrawalPool.sol:getWithdrawals() the function lacks a check to ensure that the withdrawal IDs provided in _withdrawalIds[] are valid. This could lead to erroneous or unsafe data being returned to the caller, potentially causing incorrect behavior in the broader system that relies on this function's output.
The function does not validate whether the withdrawal IDs in the _withdrawalIds array correspond to existing withdrawals in the queuedWithdrawals mapping. If an invalid ID is provided, the function will still return a zero-initialized Withdrawal struct, which could be mistaken for legitimate data.
https://github.com/Cyfrin/2024-09-stakelink/blob/main/contracts/core/priorityPool/WithdrawalPool.sol#L135-L145
In this example, calling getWithdrawals([9999]) will return a Withdrawal struct with default values (0 for uint256 types), which may cause downstream issues when the function is expected to return only valid data.
Users could receive incorrect or incomplete data if they request invalid withdrawal IDs. This could result in faulty business logic or incorrect display of withdrawal data on frontends.
manual review
Ensure that each _withdrawalId provided corresponds to a valid withdrawal in the queuedWithdrawals mapping. Add this check to the code :
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.