Skip to content

feat: add trust signals to permission picker#275

Merged
jeffsmale90 merged 11 commits intomainfrom
feat/dapp-scanning
Mar 5, 2026
Merged

feat: add trust signals to permission picker#275
jeffsmale90 merged 11 commits intomainfrom
feat/dapp-scanning

Conversation

@jeffsmale90
Copy link
Copy Markdown
Contributor

@jeffsmale90 jeffsmale90 commented Mar 4, 2026

Description

When processing a wallet_requestExecutionPermissions RPC call, trigger dappscanning of the origin domain, and security alerts scanning of the recipient address. If a positive result is returned display a warning to the user.

Manual testing steps

  1. Manually hardcode the domain to a known malicious host (in permissionRequestLifecycleHandler where it calls fetchTrustSignal())
  2. Request any permission

Expect "Malicious website" to be shown beside the website domain.

  1. Request a permission where the recipient is a known malicious address.
  2. Request any permission

Expect "Malicious address" to be shown beside the recipient address.

Screenshots/Recordings

image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Introduces new external API calls and additional async UI updates in the permission request flow, which could affect reliability/performance or display incorrect warnings if responses are unexpected.

Overview
Adds a new TrustSignalsClient that calls a dapp-scanning endpoint (GET /scan?url=...) and a security-alerts endpoint (POST /address/evm/scan) with Zod-validated responses and chain-id-to-name mapping.

Permission confirmations now kick off these scans in the background during wallet_requestExecutionPermissions, serialize updateConfirmation calls to avoid UI race conditions, and pass scan results into PermissionHandlerContent to show warning labels next to the requesting origin and recipient address.

Introduces warningLabel support in TextField and AddressField, adds new i18n keys for malicious/potentially-malicious labels, extends the HTTP client with validated POST support, and wires new required env vars (DAPP_SCANNING_BASE_URL, SECURITY_ALERTS_BASE_URL) through snap config and CI workflows.

Written by Cursor Bugbot for commit 7e702df. This will update automatically on new commits. Configure here.

- trigger request to dapp scanning api when processing a permission request
- show the result if it is WARN or BLOCK
@jeffsmale90 jeffsmale90 changed the title Feat/dapp scanning feat: request dapp scanning and display result in permission picker Mar 4, 2026
cursor bot pushed a commit that referenced this pull request Mar 4, 2026
Add translation keys for malicious and potentially malicious website labels:
- maliciousWebsiteLabel: 'Malicious website' (English)
- potentiallyMaliciousWebsiteLabel: 'Potentially malicious website' (English)

Updated all locale files with these keys. Non-English translations are
left empty for future translation work.

Refs #275

Co-authored-by: jeffsmale90 <jeffsmale90@users.noreply.github.com>
Add translation keys for malicious and potentially malicious website labels:
- maliciousWebsiteLabel: 'Malicious website' (English)
- potentiallyMaliciousWebsiteLabel: 'Potentially malicious website' (English)

Updated all locale files with these keys. Non-English translations are
left empty for future translation work.

Refs #275

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jeffsmale90 <jeffsmale90@users.noreply.github.com>
@jeffsmale90 jeffsmale90 marked this pull request as ready for review March 4, 2026 06:02
@jeffsmale90 jeffsmale90 requested a review from a team as a code owner March 4, 2026 06:02
…. Defaults to 'NONE' if no legitimate result is found.
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

@MetaMask MetaMask deleted a comment from cursor bot Mar 5, 2026
- fields with warnings
- permissionRequestLifecycleOrchestrator's updateConfirmation function
- fix tests
@jeffsmale90 jeffsmale90 changed the title feat: request dapp scanning and display result in permission picker feat: add trust signals to permission picker Mar 5, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

@jeffsmale90 jeffsmale90 merged commit 1da1a70 into main Mar 5, 2026
16 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/dapp-scanning branch March 5, 2026 19:08
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.

3 participants