Permit2 doesn't allow passing from != msg.sender #246
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
🤖_24_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/seawater/src/wasm_erc20.rs#L188-L245
Vulnerability details
Impact
All the permit operations will be disabled for users who have valid signatures from the token owners due to
msg.sender
being used instead offrom
inwasm_erc20::take_permit2
. As a result approved users won’t be able to manage positions that they have been approved to.Proof of Concept
Positions in
Seawater
are represented byERC721
contracts with approval mechanism, that means approved users can manage positions on behalf of their owners. There are alsoSeawaterAMM::incrPositionPermit25468326E
and swapIn, swapOut with Permit.However operators with valid
Permit
signatures won’t be able to manage any positions becausetake_permit2
always usesmsg.sender
as from:wasm_erc20.rs
As a result only the owner who has permitted himself can use that functionality and can’t grant anyone else who he trusts to perform operations for his position or assets.
However the purpose of permit is to allow someone to sign approve signature, so that this signature can be used by another contract to call some function on behalf of signer.
The exact same issue has been found in
PoolTogether
- code-423n4/2023-07-pooltogether-findings#113Tools Used
Manual Review
Recommended Mitigation Steps
Allow passing from address who is different from the
msg.sender
.Assessed type
ERC20
The text was updated successfully, but these errors were encountered: