You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA Medium severity issue.RewardA payout will be made for this issue
The protocol is not compatible with abstract wallets
Summary
Abstract wallet users will not be able to work with the protocol due to tx.origin.
Root Cause
The protocol has api.vy as an entry point, and other contracts strictly limit only api.vy or core.vy to call functions, whereas most functions in core.vy can only be called by api.vy contract. So the protocol uses tx.origin as a way to replace msg.sender, the following example is from core::mint:
For most cases, it works fine, as tx.origin will also be msg.sender to the API contract, but for abstract wallets, as it's essentially a contract, tx.origin will go back to the very origin of the transaction, and it will not be the wallet address. This makes abstract wallet users unable to interact with the pool.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Abstract wallet users will not be able to interact with the protocol.
PoC
No response
Mitigation
Add a account argument to the parameter, and sets this value to msg.sender in the API contract, and pass it on to the CORE contract.
sherlock-admin3
changed the title
Dry Khaki Locust - The protocol is not compatible with abstract wallets
y4y - The protocol is not compatible with abstract wallets
Sep 11, 2024
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA Medium severity issue.RewardA payout will be made for this issue
y4y
High
The protocol is not compatible with abstract wallets
Summary
Abstract wallet users will not be able to work with the protocol due to
tx.origin
.Root Cause
The protocol has
api.vy
as an entry point, and other contracts strictly limit onlyapi.vy
orcore.vy
to call functions, whereas most functions incore.vy
can only be called byapi.vy
contract. So the protocol usestx.origin
as a way to replacemsg.sender
, the following example is fromcore::mint
:For most cases, it works fine, as
tx.origin
will also bemsg.sender
to the API contract, but for abstract wallets, as it's essentially a contract,tx.origin
will go back to the very origin of the transaction, and it will not be the wallet address. This makes abstract wallet users unable to interact with the pool.Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Abstract wallet users will not be able to interact with the protocol.
PoC
No response
Mitigation
Add a
account
argument to the parameter, and sets this value tomsg.sender
in the API contract, and pass it on to the CORE contract.Duplicate of #82
The text was updated successfully, but these errors were encountered: