Skip to content

Commit 692947e

Browse files
committed
Rework content integrity section based on @jyasskin's feedback.
1 parent 1153f74 commit 692947e

File tree

1 file changed

+86
-61
lines changed

1 file changed

+86
-61
lines changed

index.html

Lines changed: 86 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ <h3>Identifiers</h3>
12481248
<a href="#identifier-based-correlation"></a> carefully when considering such
12491249
scenarios. There are also other types of access and correlation mechanisms documented
12501250
in Section <a href="#privacy-considerations"></a> that create privacy concerns.
1251-
Where privacy is a strong consideration, it is permissible to omit the
1251+
Where privacy is a strong consideration, it is permissible to omit the
12521252
`id` [=property=]. Some use cases do not need, or explicitly need to omit,
12531253
the `id` [=property=]. Similarly, special attention is to be given to the choice between
12541254
publicly resolvable URLs and other forms of identifiers. Publicly resolvable URLs can
@@ -2733,7 +2733,7 @@ <h3>Trust Model</h3>
27332733
either of the following:
27342734
<ul>
27352735
<li>
2736-
An [=issuer=] is expected to secure a [=credential=] with a
2736+
An [=issuer=] is expected to secure a [=credential=] with a
27372737
<a href="#securing-mechanisms">securing mechanism</a> which establishes
27382738
that the [=issuer=] generated the [=credential=]. (In other words, an
27392739
[=issuer=] is expected to [=issue=] a [=verifiable credential=].)
@@ -3040,110 +3040,136 @@ <h4>Semantic Interoperability</h4>
30403040
<section>
30413041
<h2>Integrity of Related Resources</h2>
30423042
<p>
3043-
When including a link to an external resource in a [=verifiable credential=],
3044-
it is desirable to know whether the resource that is pointed to is the same at
3045-
signing time as it is at verification time. This applies to cases where there is
3046-
an external resource that is remotely retrieved as well as to cases where the
3047-
[=issuer=] and/or [=verifier=] may have local cached copies of a resource.
3048-
</p>
3049-
<p>
3050-
It is also desirable to know that the contents of the JSON-LD context(s) used in
3051-
the [=verifiable credential=] are the same when used by both the
3052-
[=issuer=] and [=verifier=].
3053-
</p>
3054-
<p>
3055-
To validate that a resource referenced by a [=verifiable credential=] is the
3056-
same at verification time as it is at issuing time, an implementer MAY include a
3057-
property named <code id="defn-relatedResource">relatedResource</code> that
3058-
stores an array of objects that describe additional integrity metadata about
3059-
each resource referenced by the [=verifiable credential=]. If
3060-
`relatedResource` is present, there MUST be an object in the array
3061-
for each remote resource for each context used in the verifiable credential.
3043+
When including a link to an external resource in a [=verifiable credential=], it
3044+
is desirable to know whether the resource has been modified after the
3045+
[=verifiable credential=] was issued. This applies to cases where there is an
3046+
external resource that is remotely retrieved, as well as to cases where the
3047+
[=issuer=] and/or [=verifier=] might have local cached copies of a resource. It
3048+
is also desirable to know that the contents of the JSON-LD context(s) used in
3049+
the [=verifiable credential=] are the same when used by both the [=issuer=] and
3050+
[=verifier=].
30623051
</p>
3052+
30633053
<p class="issue" title="Mandatory listing of contexts in relatedResouce are under debate.">
30643054
The requirement that contexts be listed in `relatedResource` is currently being
30653055
debated in the VCWG. This requirement might be removed in future iterations of
30663056
the specification.
30673057
</p>
3058+
30683059
<p>
3069-
Each object in the `relatedResource` array MUST contain the
3070-
following: the [[URL]] to the resource named `id` and the
3071-
<code id="defn-digestSRI">digestSRI</code> information for the resource
3072-
constructed using the method specified in
3073-
<a href="https://www.w3.org/TR/SRI/#integrity-metadata">Subresource Integrity</a>.
3060+
To extend integrity protection to a related resource, an [=issuer=] of a
3061+
[=verifiable credential=] MAY include the `relatedResource` property:
30743062
</p>
3063+
3064+
<dl>
3065+
<dt id="defn-relatedResource">relatedResource</dt>
3066+
<dd>
3067+
The value of the `relatedResource` property MUST be associated with one or
3068+
more objects of the following form:
3069+
<table class="simple">
3070+
<thead>
3071+
<th>Property</th>
3072+
<th>Description</th>
3073+
</thead>
3074+
<tbody>
3075+
<tr>
3076+
<td>`id`</td>
3077+
<td>
3078+
The identifier for the resource is REQUIRED and conforms to the format defined
3079+
in Section [[[#identifiers]]]. The value MUST be unique among the list of
3080+
related resource objects.
3081+
</td>
3082+
</tr>
3083+
<tr>
3084+
<td>`mediaType`</td>
3085+
<td>
3086+
An OPTIONAL valid media type as listed in the
3087+
<a href="https://www.iana.org/assignments/media-types/media-types.xhtml">
3088+
IANA Media Types</a> registry.
3089+
</td>
3090+
</tr>
3091+
<tr>
3092+
<td>`digestSRI`</td>
3093+
<td>
3094+
A cryptographic digest, as defined in [[[SRI]]].
3095+
</td>
3096+
</tr>
3097+
<tr>
3098+
<td>`digestMultibase`</td>
3099+
<td>
3100+
A cryptographic digest, as defined in [[[VC-DATA-INTEGRITY]]].
3101+
</td>
3102+
</tr>
3103+
</tbody>
3104+
</table>
3105+
Each object associated with `relatedResource` MUST contain at least a
3106+
`digestSRI` or `digestMultibase` value.
3107+
</dd>
3108+
</dl>
3109+
30753110
<p class="issue" title="Unification of cryptographic hash expression formats are under discussion">
30763111
The Working Group is currently attempting to determine whether cryptographic hash
30773112
expression formats can be unified across all of the VCWG core specifications.
30783113
Candidates for this mechanism include `digestSRI` and `digestMultibase`. There
30793114
are arguments for and against unification that the WG is currently debating.
30803115
</p>
3116+
30813117
<p>
3082-
There MUST NOT be more than one object in the `relatedResource` per
3083-
`id`.
3084-
</p>
3085-
<p>
3086-
An object in the `relatedResource` array MAY contain a property named
3087-
`mediaType` that indicates the expected media type for the indicated
3088-
`resource`. If a `mediaType` is included, its value
3089-
SHOULD:
3118+
If a `mediaType` is listed, implementations that retrieve the resource
3119+
using [[[?RFC9110]]] SHOULD:
30903120
</p>
30913121
<ul>
30923122
<li>
3093-
be a valid media type as listed in the
3094-
<a href="https://www.iana.org/assignments/media-types/media-types.xhtml">
3095-
IANA Media Types</a> registry
3123+
use the media type in the `Accept` HTTP Header, and
30963124
</li>
30973125
<li>
3098-
be used when retrieving the content, such as via the `Accept` HTTP Header
3099-
</li>
3100-
<li>
3101-
match the retrieved content media type, such as via the `Content-Type` HTTP
3102-
Header.
3126+
use the media type in the `Content-Type` HTTP Header.
31033127
</li>
31043128
</ul>
31053129

31063130
<p>
3107-
Any object in the [=verifiable credential=] that contains an `id` [[URL]]
3131+
Any object in the [=verifiable credential=] that contains an `id`
31083132
property MAY be annotated with integrity information as specified in this
3109-
section by inclusion of `digestSRI`
3110-
in the object.
3133+
section.
31113134
</p>
3135+
31123136
<p>
3113-
Any objects for which selective disclosure is desired SHOULD NOT be included as
3114-
an object in the `relatedResource` array.
3137+
Any objects for which selective disclosure or unlinkable disclosure is desired
3138+
SHOULD NOT be included as an object in the `relatedResource` array.
31153139
</p>
3140+
31163141
<p>
31173142
Specification authors that write algorithms that fetch a resource based on the
31183143
`id` of an object inside a [=conforming document=] need to consider whether
31193144
that resource's content is vital to the validity of that document. If it is, the
3120-
specification MUST produce a validation error unless the resource has the
3121-
expected media type and its bytes hash to the expected digest.
3145+
specification MUST produce a validation error unless the resource matches the
3146+
expected media type and cryptographic digest.
31223147
</p>
31233148
<p>
31243149
Implementers are urged to consult appropriate sources, such as the
31253150
<a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">
31263151
FIPS 180-4 Secure Hash Standard</a> and the
31273152
<a href="https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF">
31283153
Commercial National Security Algorithm Suite 2.0</a> to ensure that they are
3129-
chosing a current and reliable hash algorithm. At the time of this writing
3154+
choosing a current and reliable hash algorithm. At the time of this writing
31303155
`sha384` SHOULD be considered the minimum strength hash algorithm for use by
31313156
implementers.
31323157
</p>
31333158
<p class="issue">
31343159
The working group is discussing if we will adopt more aspects of subresource
31353160
integrity as defined in [[SRI]] is adopted into the [[JSON-LD11]] specification as
31363161
noted in that specifications <a href="https://www.w3.org/TR/json-ld11/#security">
3137-
current security considerations</a> of that specification, this hash in the VC
3138-
can serve as an additional check towards ensuring that a cached context used
3139-
when issuing the VC matches the remote resource.
3162+
current security considerations</a> of that specification, the
3163+
approach described in this section can serve as an additional check towards
3164+
ensuring that a cached context used when issuing
3165+
a [=verifiable credential=] matches the remote resource.
31403166
</p>
31413167
<p>
31423168
An example of a related resource integrity object referencing JSON-LD contexts.
31433169
</p>
31443170

31453171
<pre class="example nohighlight"
3146-
title="Usage of the relatedResource property">
3172+
title="Usage of the relatedResource and digestSRI property">
31473173
"relatedResource": [{
31483174
"id": "https://www.w3.org/ns/credentials/v2",
31493175
"digestSRI":
@@ -3166,9 +3192,8 @@ <h2>Integrity of Related Resources</h2>
31663192
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
31673193
"image": {
31683194
"id": "https://university.example.org/images/58473",
3169-
"digestSRI":
3170-
"sha384-ZfAwuJmMgoX3s86L7x9XSPi3AEbiz6S/5SyGHJPCxWHs5NEth/c5S9QoS1zZft+J",
31713195
"mediaType": "application/svg+xml",
3196+
"digestMultibase": "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"
31723197
},
31733198
...
31743199
}
@@ -5578,7 +5603,7 @@ <h3>Data Theft</h3>
55785603
[=verifiable presentations=] are valuable since they contain authentic
55795604
statements made by trusted third parties, such as [=issuers=], or
55805605
individuals, such as [=holders=] and [=subjects=]. The storage and
5581-
acessibility of this data can inadvertently create honeypots of
5606+
acessibility of this data can inadvertently create honeypots of
55825607
sensitive data for malicious actors. These adversaries often seek to
55835608
exploit such resevoirs of sensitive information, aiming to
55845609
acquire and exchange that data for financial gain.
@@ -5589,9 +5614,9 @@ <h3>Data Theft</h3>
55895614
manage the status and revocation of those credentials. Similarly,
55905615
[=issuers=] are advised to avoid the practice of creating publicly
55915616
resolvable credentials that include personally identifiable information
5592-
(PII) or other sensitive data. Software implementers are advised
5593-
to safeguarded [=verifiable credentials=] using robust consent
5594-
and access control measures, ensuring that they remain
5617+
(PII) or other sensitive data. Software implementers are advised
5618+
to safeguarded [=verifiable credentials=] using robust consent
5619+
and access control measures, ensuring that they remain
55955620
inaccessible to unauthorized entities.
55965621
</p>
55975622
<p>
@@ -6123,7 +6148,7 @@ <h3>Code Injection</h3>
61236148
Despite the ability to encode information as HTML, implementers are strongly
61246149
discouraged from doing so, for the following reasons:
61256150
</p>
6126-
6151+
61276152
<ul>
61286153
<li>
61296154
It requires some version of an HTML processor, which increases the burden of

0 commit comments

Comments
 (0)