Skip to content

Gas Griefing Vulnerability when withdrawing native ETH #42

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeroknots
Copy link
Collaborator

@zeroknots zeroknots commented Mar 17, 2025

In the "fill on targetChain first, claim on origin later" workflow using TheCompact, ensuring solvers can successfully claim resource-locked funds is critical.

A vulnerability arises when claiming ETH as the underlying asset: if any recipient in a split claim implements a gas-griefing or reentrant receive function, it could block the entire split claim process. This would prevent all other recipients in the split from receiving their funds, even if only one recipient acts maliciously.

I suggest adding a gas stipend:

- to.safeTransferETH(amount);
+ to.trySafeTransferETH(amount, SafeTransferLib.GAS_STIPEND_NO_GRIEF);

Note: This PR is currently a draft because I’m uncertain whether this fix might introduce unintended side effects. I’d greatly appreciate feedback on the approach and potential risks.

with split

1`qfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant