Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Nov 6, 2025

Fixes an issue where initial connections between Snaps could be considered unused when updating preinstalled Snaps. The fix is to treat wallet_snap as a dynamic permission, it should probably have been marked as one in the past when wallet_requestSnaps was unblocked since that allows dynamically adding to the permission.

This in combination with a previous commit effectively means that any permissions granted in the manifest that are considered dynamic, will not be automatically revoked when the permission is removed from the manifest. This is intentional, but not ideal.


Note

Adds wallet_snap to dynamic permissions to prevent revoking initial connections and introduces a test for two-way preinstalled snap connections.

  • Controller:
    • Add wallet_snap to default dynamicPermissions in SnapController constructor to prevent unintended revocation of initial connections.
  • Tests:
    • Add test ensuring preinstalled snaps with two-way initialConnections do not trigger PermissionController:revokePermissions for wallet_snap.

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

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (0970e9e) to head (9459bf6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3729   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         418      418           
  Lines       12162    12162           
  Branches     1880     1880           
=======================================
  Hits        11953    11953           
  Misses        209      209           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding marked this pull request as ready for review November 6, 2025 13:08
@FrederikBolding FrederikBolding requested a review from a team as a code owner November 6, 2025 13:08
messenger,
state,
dynamicPermissions = ['endowment:caip25'],
dynamicPermissions = ['endowment:caip25', 'wallet_snap'],
Copy link

Choose a reason for hiding this comment

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

Bug: Broad Revocation of Wallet Permissions Globally Described

Adding 'wallet_snap' to the default dynamicPermissions array makes it revocable via revokeDynamicSnapPermissions for all snaps globally, not just those with initial connections. This could allow unintended revocation of wallet_snap permissions that were granted through other mechanisms, potentially breaking the permission model. The fix should be more targeted to only preserve initial connection permissions during updates, rather than making wallet_snap universally dynamic.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

This is known and intentional as per the PR description.

@FrederikBolding FrederikBolding added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit 5426bc0 Nov 6, 2025
122 checks passed
@FrederikBolding FrederikBolding deleted the fb/fix-initial-connections-being-revoked branch November 6, 2025 13:25
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