-
-
Notifications
You must be signed in to change notification settings - Fork 246
feat: shield-controller: check signature coverage #6501
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
Conversation
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
@SocketSecurity ignore npm/@metamask/signature-controller@33.0.0 |
07ab2a5
to
4374dbc
Compare
56b3888
to
93c68e6
Compare
origin: signatureRequest.messageParams.origin, | ||
}; | ||
|
||
const { coverageId } = await this.#initCoverageCheck( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that we can't always except coverageId
to be in the response, with the 200
status.
Please check the swagger, as it has updated recently. (please select schema
tab under the 200
response, not the example value)

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample cases of 200 responses without coverageId
~
- where origin is localhost or empty string (requests directly from metamask wallet)
- when providing invalid chain id values
In such cases, we don't proceed to process the rulesets, we straight away return the Unknown
result from the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case also applies to transaction-coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we throw an error in that case?
So basically now the init endpoint can also return a result? Kind of confusing. This creates unnecessary edge cases I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please change the API backend. I do see several issues with this change. The expectation so far is that if we have a coverage result, either for signatures, or for transactions, it always has the same format. If we don't have that, a lot of complexity is added to the whole system. (Currently we can just treat the results within the same data structure. Then we might need separate data structure. Also, missing the coverageId
might be problematic because it means we can't look up the corresponding backend calls.)
Explanation
This PR adds support for validating signature coverage to the ShieldController.
References
Checklist