-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add provider validation #156
Open
marcoscaceres
wants to merge
10
commits into
main
Choose a base branch
from
validate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+43
−5
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8494381
Add provider validation
marcoscaceres e78a79a
Update index.html
marcoscaceres 740d78a
Update index.html
marcoscaceres 2e3184a
Update index.html
marcoscaceres a97491b
Update index.html
marcoscaceres ae32976
Use range and index correctly
marcoscaceres 62fdfc3
it's a set
marcoscaceres 41e3dd4
Update index.html
marcoscaceres 51d7112
Update index.html
marcoscaceres f87ba1e
Update index.html
marcoscaceres File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
I don't think we can validate ALL aspects of the specification. If we're going to validate anything (EUDI folks would prefer we leave it all to the wallet), then we need to be clear about which extensibility points are reserved for the protocol.
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.
Right, but we can validate a lot of things when the request is passed to the browser. I agree that some aspects cannot be validated, and that can be left up to the wallet upon decrypting the request (if the request, or parts of it, is encrypted in the first place).
At the same time, we need the assurances of what to do when the user agents receive a request in a particular format.
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.
My intuition is that there is a subset of the request that the browser cares about and should validate which is the query language, specifically, the
presentation_definition
parameter in OpenID4VP which takes shape as a Presentation Exchange.That seems like something that the browser uses to help the user select which wallet has the credential that's being requested, as well as the privacy and security consequences of sharing that credential.
Beyond that, I think it would be harmful (from a security standpoint) to validate (e.g. drop an unknown parameter) the rest of the parameters.
Looking at the list of parameters in the Authorization Request we have the following, in addition to
presentation_definition
:client_id_scheme
client_metadata
nonce
scope
response_mode
None of these seem like things that the browser needs to form an opinion on, right?
As soon as we introduce any parameter that is a
DOMString
(for example,nonce
), verifiers and wallets can communicate freely through that channel. So, there is a escape hatch for any validation that holds the protocol designers and deployment back.From a security standpoint, I think that's a feature, not a bug: if OpenID4VP (or developers running servers) figure out a safer way to do things, they should be able to develop that without having to ask for browsers to catch up. For example, say there is a production fire happening somewhere, you we wouldn't our browser users to wait until all browsers are patched and redeployed to fix the issue, right?
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.
I share much of @samuelgoto's intuition FWIW. But also just want to note that there's work underway in OpenID4VP towards developing a new query language alternative to PE openid/OpenID4VP#220
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.
I wrote down a proposal here: #161 (comment)
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.
I don’t think that’s true. We could certainly enforce restrictions or other checks if we see ab/misuse of a data structure.
Playing whack-a-mole is not fun, but it’s absolutely something we would do and have done in the past. All browsers do this.
Potentially, yes. If the request was signed along with any non-standard parameters (which would get dropped by the browser before being passed to the wallet). At the same time, non-standard parameters shouldn’t be part of the request. An RP will likely need some means to check if the browser supports the request structure.
My intuition, and because of our security architecture, WebKit will drop anything non-standard.
“it depends”™️
but seriously… it’s really on a case by case basis. We definitely do this (fix browser bugs) for all other things on the web platform. This API is not different - or shouldn’t be.
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.
Spoke @samuelgoto about how this would be implemented in practice, and agreeing with @RByers that this should happen in the wallet or as it's being passed to the wallet, and not for all the things that are passed in.
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.
I'll try to update this PR soon!