-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onRevert will fail because the sender has not implemented onZetaRevert execution, resulting in the user being unable to receive a refund #215
Comments
DadeKuma marked the issue as duplicate of #489 |
DadeKuma marked the issue as insufficient quality report |
0xean marked the issue as unsatisfactory: |
@0xean |
Reasons for insufficient quality: Users have the burden to check that their tx will work correctly. There isn't a UI so any EOA users will be technical users that interact directly with this contract. These users should test their tx with dust amounts, especially if docs don't provide any info about compatibility with EOA. This is why I'm considering it as user error/QA. |
However, another problem is that the contract account will fail to be refunded if onReceive is not implemented, and users may use abstract accounts. @DadeKuma @0xean |
We can't assume that the user must use the ui to operate and the transaction will be successfully executed. |
leaving this as judged. |
0xean marked the issue as unsatisfactory: |
@0xean |
Lines of code
https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/protocol-contracts/contracts/evm/ZetaConnector.eth.sol#L90
Vulnerability details
Impact
When sending cross-chain messages, if the sender does not implement
onZetaRevert
, the sender will not receive a refund after the cross-chain call fails.Proof of Concept
ZetaConnector contracts,
onReceive
andonRevert
, if the receiver and the sender, do not implement onZetaMessage/onZetaRevert interface, the calls will all fail, resulting in revert.In onReceive, the recipient must implement the
onReceive
interface to make sense, and the caller must ensure that the recipient receives the message.However, the sender may not know that if the
onRevert
interface is not implemented, it will not be able to receive a refund:ZetaConnector#onRevert
function will revert because theonZetaRevert
interface is not implemented, and the user will not receive a refund.onRevert
has not been implemented. The sender just wants to send messages and does not know that theonRevert
interface needs to be implemented for refund.Tools Used
vscode manual
Recommended Mitigation Steps
The
onRevert
function determines whether the receiver has implementedonZetaRevert
,Or try catch,
Or determine whether the caller implements
onZetaRevert
when sending cross-chain messages.Assessed type
Error
The text was updated successfully, but these errors were encountered: