-
Notifications
You must be signed in to change notification settings - Fork 9
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
Protocol extensibility: where should we draw the line between what gets parsed and validated by the browser? #161
Comments
I have suggested before that the initial query should be more abstract - eg The verifier needs proof-of-age or right-to-work as different creds can be selected by the user, before even the wallet is instantiated. Here is that proposal. https://docs.google.com/document/d/1n7HobJ6QTsNld5rn1uuIiNw0A__L44ug/edit We can certainly try to cut this down to the bear minimum to get the user the ability to make a choice |
I posit that we should draw the line separating (a) credential selection and (b) wallet invocation: anything that helps (a) should be parsed, mediated and unbundled from anything that goes into (b) to remain, by design, unparsed and extensible. I think it may be worth revisiting an early proposal: decouple the protocol's To be concrete, here is an example of what a JS call looks like today, with the parts that I think browsers should and should not form an opinion on: // Gets a CBOR with specific fields out of mobile driver's license as an mdoc
const controller = new AbortController();
const {protocol, data} = await navigator.identity.get({
signal: controller.signal,
digital: {
providers: [{
protocol: 'openid4vp',
request: {
// what benefit do we get by validating "response_type"?
response_type: 'vp_token',
// what benefit do we get by validating "nonce"?
nonce: 'gf69kepV+m5tGxUIsFtLi6pwg=',
// same with "client_metadata"
// NOTE(goto): it was noted on the 08/26 DC CG call that client_metadata may be something
// that would be useful for the browser to get, e.g. terms of services and privacy policies
client_metadata: {},
// on the other hand, "presentation_definition" is something that is worth looking at
presentation_definition: {
// presentation exchange, the query, omitted for brevity
}
}
}],
}
}); In this formulation, the request to the wallet (e.g. By comparison, invoking OpenID4VP through custom schemes, aside from all of its challenges, got one thing right: the integration with the OS to do wallet selection was entirely decoupled from the invocation after that. So, one idea, is that, if we unbundled and decoupled the parts that browsers should absolutely form an opinion on, than we could make the rest of the request entirely opaque (by design). For example: // Gets a CBOR with specific fields out of mobile driver's license as an mdoc
const controller = new AbortController();
const {protocol, data} = await navigator.identity.get({
signal: controller.signal,
digital: {
providers: [{
protocol: 'openid4vp',
// request is opaque to the browser and doesn't get introspected
request: `__the__openid4vp__that_we_dont_introspect__asjjlkfsa__3920s__jklsfs__`,
// selector, on the other hand, is understood by the browser and affects credential selection
selector: {
// the query language that allows the OS to do credential selection
}
}],
}
}); There is probably a point to be made about making the
The The immediate benefit of this proposal, IMHO, is that it would make it very clear the delineation between the layers, with the OS doing credential selection but then getting out of way beyond that. |
It's an interesting proposal. Some initial thoughts:
|
Smart Digital Credential (SDC:)
|
The Problem
There is a series of ongoing conversations around #152 at the protocol layer, #58 at the registry layer and #156 (comment).
The tension is appearing at the degree of validation the browser should make: should the browser parse into a WebIDL the
request
field or not?On one hand, parsing the
request
gives the browser full visibility/control over the request but poses a serious problem evolving the protocol: because the WebIDL parser drops every unknown field, every extension to the protocol requires changing every browser before it could be used reliably (or worse: protocols abusingDOMString
s to pass opaque parameters). In addition to protocol extensibility, I think it is reasonable to think of security incidents that may require verifiers/holders to redeploy before it can get every browser to redeploy.On the other hand, not parsing the
request
gives theprotocol
extensibility but prevents the browser from (a) having visibility over what's being requested (and informing the user appropriately) and (b) passes a request to holders without any validation.A big part of the problem is that it is not clear which parts and why of the request should be inspected and which part shouldn't.
From what I've seen, as far as (a) is concerned, I think it is clear to me that the browser should have "at least" visibility over "what's being requested", specifically, the
presentation_definition
parameter of the OpenID4VPprotocol
, so that the browser can build a privacy risk engine. It is also possible thatclient_metadata
may give the browser some useful information too about the verifier that could be useful to construct prompts.But beyond that, I think it would be harmful to parse and validate other fields. Take
nonce
for example: there is nothing that a browser can do to validate whethernonce
is being used appropriately or not. Maybe one constructive exercise is go through the list of parameters and ask ourselves: which one of these does the browser have any reason to parse and validate?So, the problem is: where should we draw the line of what gets parsed and validated by the browser?
The text was updated successfully, but these errors were encountered: