Skip to content
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

turvec - SolCOnnector.sol address passed to lzSend() will cause fees refunded to be stucked #169

Open
sherlock-admin2 opened this issue Oct 27, 2024 · 0 comments
Labels
Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Oct 27, 2024

turvec

Medium

SolCOnnector.sol address passed to lzSend() will cause fees refunded to be stucked

Summary

SolCOnnector.sol address passed to lzSend() will cause fees refunded to be stucked

Root Cause

lzsend() passes address.this as refund address in case the send call reverts, however, in this case the address.this would be the SolCOnnector contract but no way to withdraw in this contract causing fees refunded to be stucked.

Internal pre-conditions

None

External pre-conditions

Fees refunded

Attack Path

n/a

Impact

will cause fees refunded to be stucked

PoC

https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract/blob/main/sol-cc/contracts/SolConnector.sol#L97

bytes memory payload = MsgCodec.encodeWithdrawPayload(withdrawData);
        bytes memory lzWithdrawMsg = MsgCodec.encodeLzMsg(uint8(MsgCodec.MsgType.Withdraw), payload);
        bytes memory withdrawOptions = OptionsBuilder.newOptions().addExecutorLzReceiveOption(
            msgOptions[uint8(MsgCodec.MsgType.Withdraw)].gas,
            msgOptions[uint8(MsgCodec.MsgType.Withdraw)].value
        );
        MessagingFee memory _msgFee = _quote(solEid, lzWithdrawMsg, withdrawOptions, false);
        _lzSend(solEid, lzWithdrawMsg, withdrawOptions, _msgFee, address(this)); <@

Mitigation

Recommendation:
Consider passing in an admin address that handles this instead of address.this or implement a way for withdrawal in the contract

@sherlock-admin3 sherlock-admin3 added the Sponsor Disputed The sponsor disputed this issue's validity label Nov 3, 2024
@sherlock-admin4 sherlock-admin4 changed the title Rural Frost Skunk - SolCOnnector.sol address passed to lzSend() will cause fees refunded to be stucked turvec - SolCOnnector.sol address passed to lzSend() will cause fees refunded to be stucked Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

2 participants