Skip to content

Keep the signer webview on the signer page - #223

Open
tomas-martins-crossmint wants to merge 2 commits into
mainfrom
tomas/wal-13316-check-that-signer-webview-messages-come-from-the-signer-page
Open

tomas-martins-crossmint wants to merge 2 commits into
mainfrom
tomas/wal-13316-check-that-signer-webview-messages-come-from-the-signer-page

Conversation

@tomas-martins-crossmint

Copy link
Copy Markdown
Contributor

This pull request makes the signer webview trust only the signer page it loaded. Messages from iframes or from any other origin are dropped, and the page can't navigate away from the signer origin

The signer page has no iframes and never navigates, so apps see no difference. The trusted origin comes from the URL the SDK loads, so production and staging both work with no list to keep up to date

Changes

  • DefaultWebViewCommunicationProxy handles a message only when it comes from the main frame and the origin of the loaded URL
  • A new webView(_:decidePolicyFor:decisionHandler:) allows main frame navigation only within that origin
  • Dropped messages log signer.message.dropped and blocked navigations log signer.navigation.blocked
  • Tests load a fake signer page and a fake foreign page with an iframe in a real webview, and check that only the signer page's main frame messages reach the handler

@tomas-martins-crossmint tomas-martins-crossmint changed the title Drop signer webview messages and navigations outside the loaded signer origin Keep the signer webview on the signer page Nov 4, 2026
@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge.

Reviews (2) · Last reviewed commit: "Test signer navigation through WebKit an..." · Reviewed by Greptile

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