Skip to content

Add warning related to protecting integrity of @context #1051

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

Merged
merged 8 commits into from
Apr 3, 2023

Conversation

msporny
Copy link
Member

@msporny msporny commented Feb 17, 2023

This PR addresses #956 by adding text suggested by the issue creator, with modifications to align it with the rest of the specification.


Preview | Diff

Copy link
Contributor

@peacekeeper peacekeeper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there may be some use cases where a claim includes a URL, and the issuer really only wants to attest to the URL itself, not the content behind it. In fact, in such a use case both the issuer and verifier may be perfectly happy with the content behind the URL changing from time to time. They just want to make sure that the URL itself is correct.

Anyway, this PR doesn't preclude that and in general feels very valuable, especially with regard to @context.

index.html Outdated
<strong><code>944167aaabd904ea9e35c98fd7e8794eb6dd42ae4666b036b171e87fc34cc7cc</code></strong>,
can be used to implement a local cached copy. It is possible to confirm the
SHA-256 digest by running the following command from a modern Unix command
interface line: `curl -s https://www.w3.org/ns/credentials/v2 | sha256sum`. For
convenience, the base context is also provided below.
interface line: `curl -s https://www.w3.org/ns/credentials/v2 | sha256sum`. It
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sha256sum seems less desirable than using openssl...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OR13 — Suggest the alternative command?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in aa4d74c.

index.html Outdated
Mechanisms used to secure <a>credentials</a> and <a>presentations</a>, such
[[VC-JWT]] and [[VC-DATA-INTEGRITY]], address securing the contents of the
credential itself (item #1 in the previous paragraph). The SHA-256 digest of
JSON-LD Contexts, as well as locally cached copies, address item #2 in the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably editorial, but It would be nice to not have to jump back / refer back to read the intention.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to not have to jump back / refer back to read the intention.

Yes. I would suggest bumping the 1-3 into a list, with each information item immediately followed by the mechanism used to address it. Item #3 would need some suggestion of how to address it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cb1d455.

index.html Outdated
default. It is considered a best practice to ensure that the same sorts of
protections are provided for any URL that is critical to the security of the
credential through the use of permanently cached files or cryptographic hashes.
See the <a href="https://w3c.github.io/vc-imp-guide/#content-integrity">Content
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use data-cite instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1e5723e.

Copy link
Contributor

@OR13 OR13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider comments, nits.

Copy link
Contributor

@dlongley dlongley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some suggestions.

index.html Outdated
The base context, located at
<code>https://www.w3.org/ns/credentials/v2</code> with a SHA-256 digest of
The base context, located at <code>https://www.w3.org/ns/credentials/v2</code>
with a SHA-256 digest of
<strong><code>944167aaabd904ea9e35c98fd7e8794eb6dd42ae4666b036b171e87fc34cc7cc</code></strong>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider also adding a hash of the JCS-canonized version of the context to eliminate any differences from whitespace, etc.

Copy link
Contributor

@dlongley dlongley Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-canonized hash I get if I use the current v2 context in the repo is this:

e41d1743c941b8003a4689e6e844b7f6ae0b9970ed81aa918bd781977bdba8b2

The JCS-canonized hash I get is this:

d64fce2a2f642ddf9f74a6aa01eb16efdaa822d0380d4891d310f3a1e085e671

Neither of these matches the value here, which may just be out of date.

Copy link
Member Author

@msporny msporny Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in aa4d74c ... which has a different hash than the two items above.

I'm trying to avoid the use of JCS because it isn't common tooling. The downside of doing that is, of course, any errant spacing/tabbing changes the hash.

Copy link
Member

@iherman iherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve the PR, but I would flag some thoughts for later. The recent WG discussions make a clear difference between credentials and verifiable credentials. I think once the dust settles, we will have to go through the spec with a fine comb to see when we use one term and when the other. I presume this new section is a typical case where the warning should also apply to a credential and not to a verifiable credential only (e.g., in case the verification is done by encapsulating the credential in a JWT).

(see also #1044)

@mark-moir
Copy link

I commented as requested here

@iherman
Copy link
Member

iherman commented Mar 15, 2023

The issue was discussed in a meeting on 2023-03-14

  • no resolutions were taken
View the transcript

2.4. Add warning related to protecting integrity of @context (pr vc-data-model#1051)

See github pull request vc-data-model#1051.

Manu Sporny: This one ... people gave comments on the PR and in issues and in my email inbox... I have to reconcile all that first.
… For PR 1051.
… I'll deal with all the various inputs.

Copy link
Contributor

@dmitrizagidulin dmitrizagidulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@msporny msporny force-pushed the msporny-cip-warning branch from 535dfe2 to cb1d455 Compare April 3, 2023 16:26
@msporny msporny force-pushed the msporny-cip-warning branch from cb1d455 to 6a4be3f Compare April 3, 2023 16:27
@msporny
Copy link
Member Author

msporny commented Apr 3, 2023

Editorial, multiple reviews, changes requested and made, no objections, merging.

@msporny msporny merged commit 998344f into main Apr 3, 2023
@msporny msporny deleted the msporny-cip-warning branch April 3, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants