sherlock-audit / 2023-09-perennial-judging

0 stars 0 forks source link

feelereth - The _wrap() function in MultiInvoker.sol allows specifying a different receiver address than the original depositor. This could lead to potential confusion about where the wrapped DSU ends up. #41

Closed sherlock-admin2 closed 11 months ago

sherlock-admin2 commented 11 months ago

feelereth

high

The _wrap() function in MultiInvoker.sol allows specifying a different receiver address than the original depositor. This could lead to potential confusion about where the wrapped DSU ends up.

Summary

It assumes wrapped DSU will be sent back to the deposit address. However, the _wrap() function allows specifying a different receiver. This could lead to potential confusion on where funds ended up

Vulnerability Detail

There is potential for confusion around where wrapped DSU tokens end up when using the _wrap() function in the MultiInvoker contract.

  1. The _wrap() function allows specifying a receiver address different from msg.sender to receive the newly wrapped DSU tokens: Link1
  2. By default, _wrap() is called from the _deposit() function, which passes address(this) as the receiver: Link2
  3. This means newly wrapped DSU tokens will be sent to the MultiInvoker contract by default. However, since _wrap() allows specifying any receiver, a developer could call it directly and pass a different address. This would send the new DSU tokens to that address instead of back to the msg.sender.

Impact

Tool used

Manual Review

Recommendation

Only allow wrapping to the original msg.sender:. The _wrap logic could be separated into two functions, one for wrapping to the depositor and one for arbitrary accounts if needed. But removing the ability to arbitrarily redirect funds prevents confusion.

sherlock-admin commented 11 months ago

4 comment(s) were left on this issue during the judging contest.

panprog commented:

invalid because there is no problem with this flaw, "potential confusion" is not a valid issue

n33k commented:

invalid, not convincing without PoC

darkart commented:

Work as intended

polarzero commented:

Invalid. Although it does indeed seem misleading to allow such various untracked operations, it does not seem to be a significant enough issue to be considered as medium/high severity.