-
Notifications
You must be signed in to change notification settings - Fork 13
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
[JWT encoding] JWT claim names instead of
or in addition to
their verifiable credential counterparts
#8
Comments
Verifiable Credential (as JWT)
are incorrect
@Sakurann wrote:
Can you please provide the specification text that states the above? One of the common misunderstandings of that section is missing the text that says "instead of or in addition to"... here's the full spec text:
While I disagreed with that particular wording at the time (I thought it should only be "in addition to"), because it would create interoperability issues, there was insistence to leave it in to allow the implementers to decide the best path forward. This is an issue that I hope the people doing JWT implementations fix in v2.0. My preference would be that we do the "in addition to" language so that we remove translation that must be done/undone when going to/from JWTs. The examples in the specification use the "in addition to" approach. ... but perhaps I'm missing something. @Sakurann, did you see the specific text I'm referring to above on your initial read? I'll admit that it's very easy to miss. |
ok, I see what you mean, and I now recall the conversation in Issue #4. I agree that both, the examples in tab I think what caused confusion is that, probably because the JWT-encoded example using "JWT claim names Guess a discussion point for V2 :) thanks for clarifying! |
Verifiable Credential (as JWT)
are incorrectinstead of
or in addition to
their verifiable credential counterparts
Perhaps the title should instead be —
My opinion is that in most cases, it should be |
This is an issue that I would like to see resolved as quickly as possible because we will soon be starting conformance testing for the NGI Atlantic project, and we would like to produce JWTs and tests that conform to the v2 data model. My preferred approach is that for property values that can be directly copied from credential properties into JWT claims, we mandate instead of (i.e. no duplication) and for property values that cannot be directly copied (currently all the time/date properties) we mandate in addition to. |
The major argument I see against this is its inherent complexity for users and developers. "Is this property one that I MUST or MUST NOT duplicate?" Requiring duplication in all cases is the only way I see to avoid this confusion. (Forbidding duplication in all cases has other arguments against it, including but not limited to the fact that some values cannot be directly copied.) |
This issue needs to be moved to the vc-jwt spec. |
+1 -- I'll note that the "instead of" proposal transforms the VC into a non-conformant VC when paired with JWTs (removal of mandatory "issuer" field, for one... "issuanceDate" is another example). |
I can live with duplication. The problem I then see is if the "duplicates" are different, which one takes precedent? I too would not agree with replacement everytime. Concerning the non-conformance issue regarding removal of values, I have already raised an issue on this wrt selective disclosure. |
This would seem to be addressable by specifying that conforming implementations MUST set both/all "duplicates" to the same value. Yes, non-conforming implementations (including humans) could violate this, but the next conforming tool in the stack should fire an error, so it shouldn't last long. |
Seems related to w3c/vc-data-model#844 |
One thing to mention: |
@bellebaum probably the mapping would have to be redefined, I imagine that would be the case for anything that relied on the new / old terms in the registry. |
For the record, I am very much against the "instead of path..." for mapping a credential to a "Verifiable Credential" in JWT format. Having implemented both... the "in addition too" path is easier to implement, and leads to better interoperability, and less "translation burden" when processing the claims after verification on the Verifier / RP side. |
@OR13 Can you explain how exactly there is "less translation burden"? You would still have to check the values for consistency if you do not want to ignore JWT semantics (If you do, than what's the point of using JWT in the first place rather than e.g. JWS directly?). |
There is less implementation burden, because the "in addition to path" requires less code.
Great question. I prepared this draft proposing 2 new VC security formats: VC-JWS and VC-JWE... both are much simpler than VC-JWT. If you are going to use VC-JWT, you should do so as simply as possible, and the issuer should take responsibility for data validation before signing... so the verifier does not have to "check the issuers math"... the verifier trusts the issuer.
Why? You verified the signature... you trust the issuer... In the generic case, you are done. If you want to add additional schema validation, or business processing... thats probably out of scope for the WG IMO. Adding normative requirements at this layer adds complexity, and implementation burden. It is a thing I would expect some verifiers to do... but I don't think it needs to be normatively required to enable interoperability.
Thats a pretty big burden... You are adding complexity to both the forward and backward mappings... and IMO, needlessly, since the issuer is trusted to make the claims about the subject... if they chose to sign... they approved the data they are delivering to the verifier... it is the issuer's fault if its wrong... It's not a thing that needs a super complex mapping to achieve interop and safety, imo.
VC-JWT requires some mapping... the complexity of the mapping is a risk. The current mapping is IMO completely broken, and I am proposing we start with "the simplest possible" mapping and expand from there... only when necessary.
You need to do Then after you verify, you need to map back. IMO, that is really harmful complexity, and it's not necessary since the issuer should be trusted to produce high quality data, that is easy to consume, the verifier checks the signature and applies policies to the result... the verifier should not have to worry about if terms are mapped properly, or deleted or not... etc... Relying on Based on, my experience with VC-JWT and RDF graphs derived from verification, the |
I think this is the key bit --
Since |
That is my kind of feature. Nice to see other people are concerned about this :)
After briefly looking at this, it seems to want to achieve something similar to JWT. It is simpler from a standards perspective, but lacks sufficient implementations and corresponding security considerations compared to JWT. Besides this, it seems to suffer from some of the same problems as JWT. E.g. it still has to have an
I politely disagree because of the interplay of two reasons:
So let us look at an example application taking a vc-jwt (e.g. via some REST endpoint), verifying it, transforming it to the standard JSON-LD form and adding the verified credential to its knowledge database (or feeding it to some process which requires trustworthy data). This scenario in its generic form should not be too uncommon. This kind of vulnerability should IMO be at least mentioned in the security considerations to increase the chance of library designers users knowing about this when they need to. Of course, I would prefer it if this did not exist in the first place by making the library user's expectations in the normative part of the specification. |
yes, its a draft to motivate interest / generate a reaction... its also possible that jws supports multi sig, whereas jwt does not... not clear to me yet:
I am not sure what In the case the issuer uses the coin flip to switch between
Agreed, don't role your own library... use a trusted source... but that source will only ever be as good as the spec.. which is why the spec should be simple to implement and reduce optionality. After you call
|
Let me rephrase the goal another way:
That is why we use cryptography. To minimize trust in this step. This also seems to be the way people think about cryptographic signature verification (with known keys) in general: An automatic process to validate that the signed message really originates from the private key owner, with the step of determining trust in this same entity not being part of the process. Thus also not part of any cryptographic library.
We should be explicit about the "payload". In my opinion, it is the JSON-LD W3C VC which is contained in the JWT, not the RFC 7519 JWT payload. But then: If the verification library at best looks at the As far as I can see, the only three solutions here are:
You are right, they can not protect against malicious actors. However, any responsible verifier will need to consider compromise of its trusted issuers as a potential security thread. This is a fact independent of any N.B. I am focussing on |
Yes, its pretty common of JWT libraries to not decode content until after verification... but thats in conflict with the vc data model, since you need to decode the header to obtain the key to verify the content... This is a known issue in VC-JWT.
The current normative text describes the required It is the In my proposed draft for VC-JWS, the
There is no instruction on how the Thats clearly something we need to fix. I like your 3 proposal for addressing this... But I don't know that they are needed because:
This is a binary decision, IMO. If the issuer is compromised, I don't think the attacker is going to be nice enough to make obvious data validation errors, I think they are going to make their malicious claims indistinguishable from previously legitimate and authentic ones.
I agree, compromise issuer => compromised root user... its game over.... nothing can be trusted, there is nothing to do but add them to a block list, or remove them from an allow list... we shouldn't be trying to filter their content... they are toast.
No, the verifier should use Or the verifier should treat the issuer as malicious for not following the spec.
Yep, the other claims that the verifier could be forced to check are also reserved per the JWT RFC. They include:
IMO if an issuer makes even a single mistake mapping FROM the VC Data Model TO these JWT fields when applying the The issuer is malicious or indistinguishably incompetent and should not be trusted. ... because a data mapping like this, is trivial compared to implementing a digital signature properly, or protecting a private key. As an analogy... If you were to see a soldier, take off his helmet on a live fire exercise, stick his head in front of his team member's firing line and say the words "trust me even though I am doing this"... I hope we would all know which list he/she belongs on.... no amount of "the field manual (spec) said I MUST NOT do this, but I am doing it anyway" should convince anyone to trust that soldier. Verifiers have to have absolute trust in the issuer... Or they can't process claims. There are a lot of things an Issuer could do to destroy that trust... The easiest way to destroy trust would be to map JSON members incorrectly... The more trivial the error, the less confident we all are in the issuer. Option AWe can cover this case by normatively defining the mapping for VC Data Model Credential -> { header, payload }, privateKey -> JWT Bi-directional and lossless. It a This is the simplest solution, it builds on the absolute trust assumption, and it requires the least amount of code. Option BThe next step up is Option CThe next step up after that is If the WG thinks that "B" is "worth it" or "C" is "worth it", I expect the normative requirements of VC-JWT to reflect the complete set of steps necessary to achieve them... and for all implementations to cover those requirements in both positive and negative tests... it is doable... but it is, in my opinion "not worth it"... and "not a good idea". |
@OR13 wrote:
Very interesting... |
Perhapse an object that handles |
This language has been removed, closing this issue |
All JWT-VC examples under a tab named "Verifiable Credential (as JWT)" are not compliant to the Proof Formats section 6.3.
Each property has to get transformed into a JWT claim without being duplicated inside a JWT
vc
claim.issuanceDate
->nbf
,issuer
->iss
,credentialSubject.id
->sub
,id
->jti
. Need to change.For example, Example 4 should be as below:
This transformation rule might change in v2 but can we please change this in v1.1 because it is very misleading?
The text was updated successfully, but these errors were encountered: