fix: Only reject approvals if subject has endowment:caip25 permission revoked#40139
Merged
FrederikBolding merged 3 commits intomainfrom Feb 18, 2026
Merged
Conversation
Contributor
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/wallet-integrations (2 files, +5 -2)
|
FrederikBolding
commented
Feb 16, 2026
| params: [ | ||
| { | ||
| [Caip25EndowmentPermissionName]: {}, | ||
| "eth_accounts": {}, |
Member
Author
There was a problem hiding this comment.
endowment:caip25 is currently only revokable if specifying a legacy permission
scutuatua-crypto
approved these changes
Feb 16, 2026
Contributor
Builds ready [a9615f1]
UI Startup Metrics (1397 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Mrtenz
approved these changes
Feb 16, 2026
jiexi
approved these changes
Feb 17, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 18, 2026
…on revoked (#40139) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Rejecting all approvals caused strange behavior when installing Snaps from the Snaps Directory because the directory page uses `wallet_revokePermissions`. This PR fixes it by only rejecting pending approvals from the origin if the revoked permission is `endowment:caip25`. [](https://codespaces.new/MetaMask/metamask-extension/pull/40139?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Fixed an issue where approvals would be closed too soon ## **Related issues** Fixes: #40112 ## **Manual testing steps** See attached issue <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small, well-scoped conditional change to approval rejection behavior with accompanying test update; low risk aside from potentially altering when pending confirmations are closed. > > **Overview** > Updates `wallet_revokePermissions` middleware to **only call** `rejectApprovalRequestsForOrigin` when the revocation set includes `endowment:caip25`, instead of rejecting approvals for any permission revocation. > > Adjusts the unit test to trigger approval rejection via revoking a CAIP-25-equivalent permission (e.g. `eth_accounts`) that causes `endowment:caip25` to be revoked. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a9615f1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
a9615f1 to
e5caae2
Compare
Contributor
Builds ready [e5caae2]
UI Startup Metrics (1447 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
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.
Description
Rejecting all approvals caused strange behavior when installing Snaps from the Snaps Directory because the directory page uses
wallet_revokePermissions. This PR fixes it by only rejecting pending approvals from the origin if the revoked permission isendowment:caip25.Changelog
CHANGELOG entry: Fixed an issue where approvals would be closed too soon
Related issues
Fixes: #40112
Manual testing steps
See attached issue
Note
Low Risk
Small conditional change in RPC middleware behavior with targeted test update; low risk aside from potential behavioral differences in edge cases around permission key selection.
Overview
Updates
wallet_revokePermissionsso it only callsrejectApprovalRequestsForOriginwhen the revoke set includesendowment:caip25, instead of rejecting approvals for any permission revocation.Adjusts the corresponding unit test to trigger approval rejection via a CAIP-25-equivalent permission (
eth_accounts) rather than an explicitendowment:caip25entry.Written by Cursor Bugbot for commit e5caae2. This will update automatically on new commits. Configure here.