This means a malicious user can invoke withdrawal with an arbitrary _to and block this address from claiming the tokens later (assuming claimed flag will be implemented to check against repeated withdrawals). This way, msg.sender is unaffected and can withdraw their tokens repeatedly.
Recommended Mitigation Steps
It should set the claimed[_token][msg.sender] to true and probably check that _to is not an empty address (0x0) to prevent accidental loss of tokens.
Lines of code
https://github.com/code-423n4/2022-02-concur/blob/main/contracts/Shelter.sol#L54-L55
Vulnerability details
Impact
Function withdraw in Shelter calculates the amount based on shares of msg.sender, but sets the claimed flag of _to:
This means a malicious user can invoke withdrawal with an arbitrary _to and block this address from claiming the tokens later (assuming claimed flag will be implemented to check against repeated withdrawals). This way, msg.sender is unaffected and can withdraw their tokens repeatedly.
Recommended Mitigation Steps
It should set the claimed[_token][msg.sender] to true and probably check that _to is not an empty address (0x0) to prevent accidental loss of tokens.