This repository was archived by the owner on Jul 31, 2026. It is now read-only.
fix: handle non-url origins - #340
Open
0xEdouardEth wants to merge 1 commit into
Open
Conversation
This was referenced Jun 25, 2026
0xEdouardEth
force-pushed
the
fix/validate-origin-url
branch
3 times, most recently
from
June 26, 2026 13:27
a540cfd to
548af0c
Compare
0xEdouardEth
marked this pull request as ready for review
June 26, 2026 13:45
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 548af0c. Configure here.
| // If not a valid URL, return the original value | ||
| // This shouldn't happen if validation is working correctly | ||
| return origin; | ||
| return ''; |
There was a problem hiding this comment.
Unknown origin shows blank label
Medium Severity
Sign-transaction confirmation sets missing origins to the literal 'Unknown', then runs formatOrigin on that value. After this change, formatOrigin returns an empty string for non-URL strings, so the origin row still renders (the prop is truthy) but the value is blank instead of Unknown.
Reviewed by Cursor Bugbot for commit 548af0c. Configure here.
0xEdouardEth
force-pushed
the
fix/validate-origin-url
branch
from
June 26, 2026 13:59
548af0c to
497f871
Compare
4 tasks
7 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.


Explanation
This PR updates the Tron Snap origin formatter to handle the stable
wallet-connectorigin used by MetaMask Mobile WalletConnect multichain requests.The change is intentionally limited to display formatting:
metamaskis displayed asMetaMask;wallet-connectis displayed asWalletConnect;This PR no longer changes the Security Alerts / Blockaid request payload or transaction scan flow. Existing scan behavior, including the existing MetaMask origin URL mapping, is preserved.
References
Checklist
Validation
Result: 1 test suite passed, 6 tests passed.
Result: passed.
Note
Low Risk
Display-only formatting in confirmation UI with no changes to signing, scanning, or security payloads.
Overview
Updates
formatOriginso confirmation UIs can show stable Mobile/WalletConnect origins without surfacing raw channel IDs or invalid strings.metamaskandwallet-connectnow resolve to MetaMask and WalletConnect via a case-insensitive lookup table. Valid http(s) URLs still show the hostname; other values (bare hostnames, parse failures, non-http schemes) return''so{origin ? …}guards omit the origin row instead of echoing meaningless text.Tests and an Unreleased changelog entry document the new behavior.
Reviewed by Cursor Bugbot for commit 497f871. Bugbot is set up for automated code reviews on this repo. Configure here.