Skip to content

Allow Advanced Permissions metadata in signtypeddata payload#8603

Merged
jeffsmale90 merged 1 commit intomainfrom
fix/signtypeddata-metadata
Apr 28, 2026
Merged

Allow Advanced Permissions metadata in signtypeddata payload#8603
jeffsmale90 merged 1 commit intomainfrom
fix/signtypeddata-metadata

Conversation

@jeffsmale90
Copy link
Copy Markdown
Contributor

@jeffsmale90 jeffsmale90 commented Apr 28, 2026

Explanation

#8526 adds tighter validation to signtypeddata v4 payloads, to ensure that no extraneous properties are added.

This additional validation disallows Advanced Permissions metadata which is used to communicate the origin and justification of the permission.

This change loosens the validation just enough to allow metadata: { justification: string; origin: string } as a property on the payload that is not used within the message encoding.

References

#8526
MetaMask/metamask-extension#42181

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Touches security-adjacent request validation for typed-data signing; while the new metadata allowance is tightly constrained, any loosening here could affect input filtering behavior.

Overview
Relaxes signTypedData (V4) payload validation to permit an additional top-level metadata field used by Advanced Permissions.

validateTypedMessageKeys now explicitly allows metadata and enforces it is exactly { justification: string, origin: string } (rejecting non-objects, missing/typed fields, or extra keys), with new unit tests covering the allowed and rejected cases; changelog updated accordingly.

Reviewed by Cursor Bugbot for commit 17f9432. Bugbot is set up for automated code reviews on this repo. Configure here.

@jeffsmale90 jeffsmale90 requested a review from a team as a code owner April 28, 2026 06:45
@jeffsmale90 jeffsmale90 force-pushed the fix/signtypeddata-metadata branch from 51e1409 to 17f9432 Compare April 28, 2026 06:49
@jeffsmale90 jeffsmale90 added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit c947237 Apr 28, 2026
362 checks passed
@jeffsmale90 jeffsmale90 deleted the fix/signtypeddata-metadata branch April 28, 2026 08:04
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