Skip to content

Handle muxed account during buildTransaction and CheckForForbiddenSigners#500

Merged
aditya1702 merged 3 commits intomainfrom
muxed-acc-fix
Feb 10, 2026
Merged

Handle muxed account during buildTransaction and CheckForForbiddenSigners#500
aditya1702 merged 3 commits intomainfrom
muxed-acc-fix

Conversation

@aditya1702
Copy link
Contributor

What

  • Handle muxed account by using the XDR function to convert an address to muxed and validating the inner G address

Why

The current logic incorrectly bypasses our checks if an address is a muxed account with the wallet-backend's channel account as the G address. This is a security bug and we now correctly handle it.

Known limitations

N/A

Issue that this PR addresses

Closes #499

Copilot AI review requested due to automatic review settings February 10, 2026 16:52
@aditya1702 aditya1702 self-assigned this Feb 10, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a security gap where muxed (M...) Stellar addresses could bypass forbidden-signer/channel-account source checks by resolving them to their underlying Ed25519 G-address before validation.

Changes:

  • Added ResolveToGAddress utility to normalize G/M addresses to the underlying G-address.
  • Updated CheckForForbiddenSigners to validate muxed op source accounts against forbidden signers.
  • Updated transaction building validation to block using the channel account via muxed source accounts; added corresponding tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/utils/utils.go Adds ResolveToGAddress to normalize muxed addresses for consistent validation.
pkg/utils/utils_test.go Adds unit tests for ResolveToGAddress (empty, G, M, invalid).
pkg/sorobanauth/sorobanauth.go Resolves op source to G-address before forbidden-signer checks.
pkg/sorobanauth/sorobanauth_test.go Adds muxed-account cases to forbidden-signer tests.
internal/services/transaction_service.go Resolves op source to G-address to prevent channel-account bypass via muxed addresses.
internal/services/transaction_service_test.go Adds regression test ensuring muxed channel-account sources are rejected.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +126
// ResolveToGAddress resolves a Stellar address (G-address or M-address) to its underlying G-address.
// For G-addresses, it returns the address unchanged. For M-addresses (SEP-23), it strips the memo ID.
func ResolveToGAddress(address string) (string, error) {
if address == "" {
return "", nil
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc comment for ResolveToGAddress doesn’t mention that an empty string is treated as a valid input and returns "" with a nil error. Consider documenting this behavior (or returning an error) so callers don’t accidentally treat missing source accounts as successfully-resolved addresses. Also, the muxed account’s 64-bit value is an ID; calling it a “memo ID” here may be misleading—“muxed account ID” would be clearer.

Copilot uses AI. Check for mistakes.
@aditya1702 aditya1702 requested a review from a team February 10, 2026 21:48
@aditya1702 aditya1702 merged commit 083e68d into main Feb 10, 2026
9 checks passed
@aditya1702 aditya1702 deleted the muxed-acc-fix branch February 10, 2026 21:48
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.

Validate muxed accounts by extracting the inner G address

2 participants