fix: validate Ethereum destination on bridge withdrawal#1248
Open
ouicate wants to merge 2 commits into
Open
Conversation
Reject malformed DestinationAddress values during MsgRequestBridgeWithdrawal.ValidateBasic to match bridge mint validation and avoid execution-time signature failures.
Collaborator
|
This is valid fix, targeted for user experience preventing users from mistakes in address. |
a-kuprin
approved these changes
Jun 1, 2026
Author
|
Please take a look @GLiberman |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes a validation gap where
MsgRequestBridgeWithdrawalaccepted malformedDestinationAddressvalues atValidateBasicand only failed later during BLS signature preparation. Users paid gas for transactions that could never succeed, whileMsgRequestBridgeMintalready rejected the same malformed addresses up front.Root Cause
MsgRequestBridgeWithdrawal.ValidateBasiccheckedDestinationAddressfor non-empty length only.DestinationBridgeAddresswas validated withisValidEthereumAddress, but the user's ultimate Ethereum recipient was not. The handler calledethereumAddressToBytes(recipient)inprepareBridgeWithdrawalSignatureData, which failed after the message was already included in a block.Fix
isValidEthereumAddresstoDestinationAddressinMsgRequestBridgeWithdrawal.ValidateBasic, matchingMsgRequestBridgeMint.Why This Closes The Vulnerability
Malformed withdrawal destinations are rejected before broadcast, eliminating wasted gas and inconsistent UX between symmetric bridge mint and withdrawal flows. Execution-time failures from invalid recipient encoding on the withdrawal path are no longer reachable through
ValidateBasic-accepted messages.Test plan
go test ./x/inference/types/... -run 'Withdrawal|BridgeWithdrawal'MsgRequestBridgeWithdrawalwithDestinationAddress = "0x12345"and confirmValidateBasicerror before executionSupersedes #1197 (closed because the head fork was accidentally deleted; this branch is a clean rebase onto current
main).