feat: Perform dappscanning when any EIP-7715 related request is received#40587
feat: Perform dappscanning when any EIP-7715 related request is received#40587HowardBraham merged 3 commits intomainfrom
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [3a25058]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [7dcb26c]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Builds ready [7ac3033]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
wzrdk3lly
left a comment
There was a problem hiding this comment.
PR looks good to me. Due to EIP-7715 not requiring the traditional connect wallet flow, I agree dapp scanning should be performed for EIP-7715 request.
AugmentedMode
left a comment
There was a problem hiding this comment.
The scan triggering is correct and will populate the urlScanCache. However, the warning won't actually display on the first screen the user sees -- the snap dialog renders through TemplateAlertContextProvider which doesn't include useOriginTrustSignalAlerts. The warning only surfaces on the second step (the eth_signTypedData_v4 delegation signing screen), which uses the redesigned confirm flow that does wire in origin trust signal alerts. Just flagging the gap so it's a conscious decision.
Can you confirm this is what you are expecting ? This PR will fill the cache. But in order to fire an alert this hook must be called useOriginTrustSignalAlerts
|
@AugmentedMode thanks for the detailed feedback! Yes that's exactly what we are after here. MetaMask/snap-7715-permissions#275 fetches directly from the service and surfaces the alert in the snap dialog. |



Description
EIP-7715 specifies some new RPC methods that are available without a wallet connection:
wallet_requestExecutionPermissionswallet_getGrantedExecutionPermissionswallet_getSupportedExecutionPermissionsBecause
wallet_requestExecutionPermissionsallows a dapp to request permissions from the wallet, it's important that we trigger dapp-scanning of the dapp's domain as early as possible, to ensure the greatest likelihood that a response is available to warn the user.This PR adds the three RPC methods listed above to the methods that will trigger dapp scanning when called.
Changelog
CHANGELOG entry: Trigger malicious website scanning when any EIP-7715 RPC method is executed
Testing
Expect a request to https://dapp-scanning.api.cx.metamask.io/scan?url= (or otherwise configured dapp-scanning URL
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds new RPC methods to the trust-signals scan trigger path, which can increase phishing scan calls and affect UX/performance for dapps using EIP-7715. Behavior change is localized and covered by targeted tests.
Overview
Adds the EIP-7715 execution-permissions RPC methods (e.g.
wallet_requestExecutionPermissions) to the set of requests that trigger dapp origin scanning viaphishingController.scanUrl, even when no connection is established.Introduces
MESSAGE_TYPEconstants and a newisEip7715AdvancedPermissionsRequesthelper, and extendstrust-signals-middlewaretests to assert scanning occurs only when anoriginis present for each new method.Written by Cursor Bugbot for commit 7ac3033. This will update automatically on new commits. Configure here.