fix: pin signer address and verify it on lockAssets/unlockAssets/setBoost - #178
Merged
prodbycorne merged 5 commits intoAug 16, 2026
Merged
Conversation
✅ Deploy Preview for spiffy-melomakarona-eb1e8a ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for smart-drop ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…address Freighter's signTransaction accepts an optional address field to pin which account is required to sign. Widening the type here so call sites can start passing it.
…actionXdr Adds an expectedSigner parameter and throws a SecurityError when Freighter's response reports a signerAddress that disagrees with it, before the caller ever gets a signed XDR back to submit. Responses that omit signerAddress (older Freighter versions, or the legacy bare-string shape) are unaffected since there's nothing to check against.
…t signing calls Passes address: userAddress in the signTransaction request (letting Freighter itself refuse a mismatched account) and the expected signer into getSignedTransactionXdr's new check, for all three flows that sign and submit a transaction on the user's behalf. Closes SmartDropLabs#139
signTransaction's options now include address, so the existing exact call-shape assertion needs to expect it too. Also imports SecurityError ahead of the new signer-pinning tests.
Adds cases for each of the three signing flows: a mismatched signerAddress rejects with SecurityError and never reaches sendTransaction, a matching signerAddress proceeds normally, and the legacy bare-string signTransaction response (no signerAddress field) is still accepted unchanged.
abayomicornelius
force-pushed
the
fix/pin-signer-address
branch
from
August 16, 2026 23:52
44447b1 to
902f7f3
Compare
Contributor
|
All ci s passed |
4 tasks
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
lockAssets,unlockAssets, andsetBoostcalled Freighter'ssignTransactionwithout pinningaddress, so any connected account could sign, and the returnedsignerAddresswas never checked against the account SmartDrop believes is connected.address: userAddressis passed in the signing request (so Freighter itself can refuse a mismatched account), andgetSignedTransactionXdrthrows aSecurityErrorifresult.signerAddressdisagrees with the expected account — beforesendTransactionis ever reached. Legacy bare-stringsignTransactionresponses (nosignerAddressfield) are unaffected.Closes #139
Test plan
npx vitest run src/lib/soroban.service.test.ts— new signer-pinning tests pass (mismatch rejects withSecurityErrorand never callssendTransaction; matching signer proceeds;addressis passed through; legacy bare-string response still works)npx vitest run(full suite) — no new failures (one pre-existing, unrelatedformatCreditsrounding failure confirmed present on a cleanupstream/mainbaseline)npx tsc --noEmit— cleannpm run lint— clean (only pre-existing unused-var warnings, unrelated to this change)npm run build— succeedse2e(Playwright) — could not run locally (Playwright's chromium build isn't supported on this machine's macOS version); will verify on the PR's GitHub Actions run