-
Notifications
You must be signed in to change notification settings - Fork 115
Default vocab for credentials context v2 #753
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
Comments
I think defaulting is probably slightly better than dropping properties, but throwing an error remains the best thing to do here. The question remains, why would you sign anything you don't understand? If we added Right now, using undefined terms is more likely to cause an error. I'm not sure if this is an improvement but if "undefinedTerm" had a human readable definition that said "don't trust anything from this issuer until they define this term"... I supposed that would be an improvement over what we have today. |
This is not a new problem or issue. LDAP introduced the extensibleObject object class for the same reason, so that undefined attributes could be added to an LDAP entry. Personally I dont like this. I think all VCs that cannot be fully understood should be rejected. This is because, different to LDAP entries, VCs are primarily security tokens. So having unknown information in a security token is dangerous. If you want to address this in a secure way, you should consider doing something like X.509 with its critical extension feature. With this feature, every attribute at the outer level is fully understood, even if an inner value is not. But the outer level says whether you can safely ignore inner values or not. |
@tplooker and I had a chat about this... I can see the advantage of "making the tent bigger" by welcoming folks who don't understand why signing unknown properties might not be a good idea, weakening the security model of VCs if we can add the following to the spec:
A JSON-LD Processor SHOULD throw an error when the A JSON-LD Processor MUST warn if no error is thrown and
Reasons this would be better than what we have today.
Throw Error > Default Member and Produce Warning > Default Member > Drop Property and Produce Warning > Drop Property. We should start at the top, and only compromise when the risk to users is outweighed by the convenience to developers, and we are honest about which constituency we care more about in the spec. |
Another option we discussed, is for the default vocab to be defined as a security term that in present in both the credentials and security context and therefore making it a concept present at the JSON-LD signatures level not just a verifiable credentials concept (so instead of |
I don't know.. This sounds like If there's an undefined term in your JSON-LD, the processor should simply throw an error... |
@peacekeeper I understand that it appears as a contradiction. To be clear I think in general JSON-LD processors SHOULD at least emit a warning when any property is expanded with |
If we are talking about a spec where we get to make normative requirements, I would repeat my assertions:
This is a spec related to cryptographic assertions / security... swallowing errors / warning is a terrible idea from a security perspective.... I can understand developers from untyped languages like javascript or python feeling like types are a "burden" and "slow me down / are confusing"... but frankly... they are wrong :) types and strictness are part of good security engineering... we should not be failing open... we should be failing closed. |
This issue goes right to the core of the extensibility model for verifiable credentials. If we look at neighbouring technologies such as JWT they support what are known as public and private claims where public are recommended to be registered in the IANA registry, private are subject to collision and should be used with caution. At the moment we force users of verifiable credential technology when expressing in JSON-LD to define all their properties in some form in the JSON-LD context (note they are free to use |
I also dont think a signed property that has been expanded to an IRI of |
I personally don't like seeing warnings, and I don't like setting I don't think we should hand developers a tool which lets them accidentally poison themselves and their users... the recommendation should remain to at least warn, and best practice would be to throw. I do think making changes to the VC Data Model in this regard would be helpful, but I would formally object to swallowing undefined terms by adding |
case in point, if I add The fact that including schema.org allows for this exploit today, with no changes, does not mean we should normalize this behavior... it means we should patch the VC Data Model spec immediately to throw when |
+1 to a warning |
perhaps we can split this up into:
I could be supportive of both, but 1 is decidedly less controversial given the disclosed issue above. |
apparently folks are already exploiting this behavior... https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/inspectors/computeLocalHash.js#L67 |
This is not what happens in practise. If you look at today's browsers and interception products with X509 certs, they typically fail open rather than closed, because usability trumps security. We have written about this extensively, see for example Wazan, Ahmad Samer; Laborde, Romain; Chadwick, David W; Kallel, Sana; Venant, Rémi; Barrere, François; Benzekri, Abdelmalek; Billoir, Eddie. "On the Validation of Web X.509 Certificates by TLS interception products", IEEE Transactions on Dependable and Secure Computing (2020). Print ISSN: 1545-5971, Online ISSN: 1545-5971, Digital Object Identifier: 10.1109/TDSC.2020.3000595 A.S. Wazan, R. Laborde, D.W. Chadwick, F. Barrere, A. Benzekri. "TLS Connection Validation by Web Browsers: Why do Web Browsers still not agree?". 41st IEEE Computers, Software, and Applications Conference (COMPSAC 2017), Politecnico di Torino, Turin, Italy July 4-8, 2017 Ahmad Samer Wazan, Romain Laborde, David W Chadwick, François Barrere, AbdelMalek Benzekri. “Which web browsers process SSL certificates in a standardized way?” 24th IFIP International Security Conference, Cyprus, May 18-20th, 2009
And users typically click through warnings, so they are ineffective, hence pointless. |
Big -1 to this :) for at least the following reason: This is a security vocabulary and reasonable defaults should lead to failing closed. Having a default This is why it's a good thing that it's so difficult to get digital signature libraries to validate a digital signature... it's a like a very advanced lock on a door protecting your most treasured secrets... if all the tumblers don't line up just right, the door shouldn't open. Remember that developers may not include this context in their proof, but at the top level of their object and by doing so, you may obliterate assumptions they may have about So, let's please drop this on the floor as the bad idea that it is -- no default |
That's terrifying. |
@msporny might we consider adding a warning or throwing an error if |
I think we've got a tooling problem -- not a spec problem here. We need better tools that make things easier for people to check their vocabularies, figure out what to do to fix them, or automate this process for them in a safe way. I don't think we need to (or should) change the core security underlying it all. VCs are improvements over existing systems for a number of reasons, one of which is the fail closed model -- where you have to define what you're talking about/signing vs. there being ambiguity around it -- whilst still allowing for decentralized extensions. The community just needs to make it easier for people to create and test those extensions. |
@dlongley nobody is going to implement tooling support for non-normative requirements... IMO this is a spec issue, and presence of
Both of these are "valid interpretations of the vc api" imo, they are not good... would prefer to see them be forbidden. In absence of spec changes, how might we address this? |
Ok so can we clarify the intended behaviour here, e.g in ANY case of using I believe it should at least warn, as it is trivial to include in a documents context today a context that makes use of On a side note a similar question applies to usage of Secondly can someone please explain in more detail why failing on un-documented terms vs signing them under an IRI that clearly states, no clear definition is failing open? Finally as @OR13 pointed out earlier, we (Mattr) originally looked at this as a solution because of 199 and without a solution to it, I would posit that a default vocab in a v2 credentials context is 100 times less of a security risk than silently dropping terms... |
@David-Chadwick would you not still be able to detect which terms are fully understood with the expanded IRI that was used e.g |
Or better still |
In X.509 you dont say whether the term is undefined or not, rather the recipient decides if it understands it or not. But each extension (term) is marked critical or not. Critical means you HAVE to understand it or reject the certificate. Not critical means you can safely ignore this term if you dont understand it. So mapping this to undefined schema terms, then each one would need to be marked critical or not. A recipient that understands the undefined term that is marked critical can process the VC, all other recipients would have to reject it. If the undefined term is marked non-critical than all recipients can safely ignore it if they dont understand it. Those that do will still process it. All defined schema terms are implicitly critical. This is the current implied meaning of the W3C recommendation. |
So in this model you are saying that all properties in a VC MUST always be understood by the verifier, otherwise it should reject it, meaning there is no notion of optionally processed information in a VC? |
Agree, because on the surface just because a term has a formal definition it does not directly imply that every consumer understands that definition, unless you impose the constraint you spoke of above that all terms MUST have definitions and all verifiers MUST always understand ALL definitions for the terms featured in the data they are consuming. |
This issue is a bit of a tire fire... can we split this up into a few separate issues? IMO they should be:
We don't need to agree to all 3, but we should be able to easily agree to 1. |
Yes but that continues to be the point, making this a blocking concern up front just means people either
Pushing for all of the education around JSON-LD to be critical path to just getting started with VC's will damage its adoption.
This is the wrong analogy, undefined term is not equivalent to an undefined variable its equivalent to an un-typed variable IMO. Which means @OR13's analogy around JS and TS are the right framing. |
While I do find some of the arguments around usability compelling, I remain concerned around subtle vulnerabilities or threats that haven't been adequately discussed. For example, suppose: Credential Type A uses the undefined term "foo" (which falls back to a globally unambiguous value using Credential Type B uses the undefined term "foo" (which falls back to a globally unambiguous value using Different issuers of A and B do not mean the same "foo" -- and perhaps the difference is stark or perhaps it is subtle. What happens when these things are confused in the marketplace for one another? How bad is the damage? Who is liable? How does this possibility affect the previous guarantees or promises made to the users of VCs? How does that impact uptake of VCs in the marketplace? Using a default If the advocates for a default
We should also consider a way to reinstate globally unambiguous definitions as mandatory later on down the line -- once VCs are well adopted. Perhaps this could be as simple as having people upgrade to a new context and having verifiers prefer VCs that use the new context (that lacks the default |
Btw, work is being done in the jsonld.js JavaScript JSON-LD processor to provide an option to throw errors in all cases where terms are not fully defined. DB's plan is to make all of our Data Integrity Proof (formerly LD Proofs) code always run with that option turned on. This isn't a spec level change (to JSON-LD), but it could be in the future. |
VCs are operating in a space where we both want to enable security and authenticity -- but also open world flexibility and decentralization. The reason VCs had to be invented, IMO, is because other technologies that are close to the space have always fallen into one end of the spectrum or the other and neither is suitable for use in the main area of use cases that lie between. We're trying to distribute trust without having to distribute infrastructure. We're likely going to need to adopt some blend here as well to get the adoption we need without losing the most important security benefits. We should also consider that the flexible technology choices we've already made allow for us to adapt with time -- as the needs of today may not be the needs of tomorrow. |
IMO the semantics of Another point I would make is that because |
To be clear I'm in favour of a proposal that both incorporates both a default vocab in the VC context and normative guidance around implementations throwing warnings when |
Implementations could then elect to have stricter processing rules like throw an error instead of just a warning. |
I am in agreement with this approach and think it is extremely sane |
I suggest instead using -- "@vocab":"https://example.org#undefinedTerm#" -- because an accidental DDoS on This doesn't solve the problem of Credential Type A and Credential Type B both using the same unqualified term "uqt" in their JSON, and thus both falling back to the same qualified term "https://example.org#undefinedTerm#uqt", although they intended completely different meanings in A than in B ... but it does at least include the suggestion of a problem, as nothing based in |
I am a server administrator and I want to set up a firewall, so that my server can only be used for the services I intend to be used. So I configure the exact TCP/IP rules for the various services. Then someone complains to me that they can't reach something on my server. So, to fix the problem, I set up a 0.0.0.0/0 allow-all firewall rule on top of my existing rules, to improve usability. That's how |
@peacekeeper, you're not wrong -- that analogy made me chuckle. :) Since everything in JSON-LD maps to a URL, it's not as terrible as just letting everything through (as in the firewall example above). You can set up a rule to redirect "everything else" to a particular namespace. So, you can contain the "damage" to a degree. We could add a "developer mode" context that does have a Another possibility is to just use the term as a blank node, via something like That The thing that I'm still not sold on is this notion that not having At the same point, we don't want to become the XHTML of the Web, raising an error even on correctable input... we all know how that ended -- HTML5 won because it was more lax and easier to work with for a class of authors that just didn't care about well formed documents. JSON-LD was intended to allow lazy development up until the point of production, and that's one of the reasons why In any case, there are enough options here where I feel like we'll eventually get to consensus... and in the meantime, people seem to be deploying VCs to production (even if it's not entirely a great experience at present). I'd put my money on better tooling helping that along more than |
I'm forgetting the same reason(s). This might actually be the best immediate path forward, all things considered. |
Its a major problem with doing them in JSON-LD.... its not a problem if you are just using JOSE to sign JSON. I think JOSE will be increasingly the preferred solution if we don't address this concern correctly. |
I agree with this statement:
I appreciate the thrust of @tplooker 's intent with this issue. |
The problem with that approach is that it doesn't avoid the errors that people want to avoid. These errors are raised because terms have not been mapped to globally unambiguous identifiers. If you map terms to blank nodes, then the same error will end up being thrown because the term still isn't globally unambiguous (it won't translate to a valid predicate to be signed or verified). So, for code that properly checks that terms are unambiguously defined and raises errors when they are not, the outcome will be the same. So, it seems that, if |
To elaborate on this a little more I think the reason why we cannot use blank nodes for expansion here is because the canonical form that gets signed when using JSON-LD signatures is a set of N-Quads (a serialization of RDF) which does not support relative IRI's. Correct me if I am wrong @dlongley?
@dlongley is your concrete proposal for the value to be |
That's right (nor does it support blank node identifiers in the predicate position).
I definitely didn't mean to imply that everyone would define their own URL. I was just trying to avoid a bikeshedding exercise in my comment. To be clear: there should be exactly one URL for this and it goes into the VC 2.0 |
+1 |
A clarification question; the default If that is the case I believe it meets the goal of providing an easy entry for new developers to get started with Verifiable Credentials and JSON-LD, while ensuring systems are capable of detecting undefined terms. The default |
This comment was marked as resolved.
This comment was marked as resolved.
The issue was discussed in a meeting on 2022-08-03
View the transcript6.6. Default vocab for credentials context v2 (issue vc-data-model#753)See github issue vc-data-model#753. Michael Jones: 843 is one of a set of issues we're going to have about support specifically for JSON-LD in the core data model.. Brent Zundel: Thank you Mike, I agree that is a conversation the working group will be having - not today..
Brent Zundel: 753... Keeping in the core data model?. |
A recent discussion on this has been going on Twitter: https://twitter.com/OR13b/status/1571223765106802689 Recording here for posterity: Orie Steele @OR13b @Gkellogg @philarcher1 uses @danbri's idea to disable remote context loading via vocab... @selfissued @kristinayasuda ... Some ideas from vc-jose draft in here to... + RFC9278 : ) Does it matter who signs content that is injected in web pages? Gregg Kellogg @gkellogg · Sep 17 Replying to @OR13b Dan Brickley @danbri · Sep 17 In RDF, RDFS (& OWL) are optional. Obviously catching errors & falsehoods is important - but use of @-context comes at huge complexity cost too. Wrong terms = semantically boring, but mostly harmless. Gregg Kellogg @Gkellogg · Sep 17 Orie Steele @OR13b · Sep 17 Dan Brickley @danbri · Sep 18 Orie Steele @OR13b · Sep 18 |
This is now a duplicate of #953, closing in favor of the newer issue which is where it seems the discussion has moved to. |
JSON-LD defines a way to specify the default vocabulary for properties and types that otherwise do not match a term definition. Currently the credential context v1 does not make use of this feature, meaning producers of VC's must be explict in their term decelerations for all properties used, otherwise the jsonld signatures signing process will error due to the usage of a strict expansion map that requires all properties to be defined.
If instead a default vocabulary was included in a new revision of the credentials context, then the signing process would proceed and the properties without a formal term definition would be expanded with the default vocab. Take for instance the following example where the credentials context v2 would include the definition of "@vocab" set to "https://www.w3.org/2018/credentials/undefinedTerm"
The properties "someClaim" and "someOtherClaim" during signing would be expanded to be
https://www.w3.org/2018/credentials/undefinedTerm#someClaim
andhttps://www.w3.org/2018/credentials/undefinedTerm#someOtherClaim
which when browsed to would resolve to a page informing the user that the property is not formally defined and perhaps link to some helpful resources on how to define the term formally.The text was updated successfully, but these errors were encountered: