Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adding validation for primary type of types sign signatures #29379

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Dec 20, 2024

Description

Types sign request to not allow invalid primary types.

Related issues

Fixes: #22899

Manual testing steps

  1. Go to test dapp
  2. Submit signature with text "Invalid primary type"
  3. Request should be rejected and not open MetaMask

Screenshots/Recordings

Screenshot 2024-12-20 at 3 34 16 PM

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.

@jpuri jpuri added the team-confirmations Push issues to confirmations team label Dec 20, 2024
Copy link
Contributor

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.

Copy link

socket-security bot commented Dec 20, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@metamask/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@jpuri
Copy link
Contributor Author

jpuri commented Dec 20, 2024

@SocketSecurity ignore npm/@metamask/[email protected]

@jpuri
Copy link
Contributor Author

jpuri commented Dec 20, 2024

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot metamaskbot requested review from a team as code owners December 20, 2024 10:27
@jpuri jpuri enabled auto-merge December 20, 2024 11:38
@metamaskbot
Copy link
Collaborator

Builds ready [a23d465]
Page Load Metrics (1824 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28221381658486233
domContentLoaded13972125179516881
load14052178182417283
domInteractive20143462813
backgroundConnect8101312713
firstReactRender18106532813
getState4481094
initialActions01000
loadScripts10331651133415876
setupStore689162110
uiStartup157927562127266128
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 113.57 KiB (2.06%)
  • ui: 0 Bytes (0.00%)
  • common: 272.89 KiB (3.38%)

@jpuri jpuri added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 2eced17 Dec 20, 2024
77 checks passed
@jpuri jpuri deleted the typed_sign_primarytype_validation branch December 20, 2024 12:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2024
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Signatures - MetaMask breaks with the error Invalid primary type definition
4 participants