@@ -29,9 +29,9 @@ impunity. Ideally, authors would not only be able to pin the keys of a
29
29
server, but also pin the _ content_ , ensuring that an exact representation of
30
30
a resource, and _ only_ that representation, loads and executes.
31
31
32
- This document specifies such a validation scheme, extending several HTML
33
- elements with an ` integrity ` attribute that contains a cryptographic hash of
34
- the representation of the resource the author expects to load. For instance,
32
+ This document specifies such a validation scheme, extending two HTML elements
33
+ and the ` fetch() ` API with an ` integrity ` attribute that contains a cryptographic hash
34
+ of the representation of the resource the author expects to load. For instance,
35
35
an author may wish to load some framework from a shared server rather than hosting it
36
36
on their own origin. Specifying that the _ expected_ SHA-256 hash of
37
37
` https://example.com/example-framework.js `
@@ -60,7 +60,7 @@ and future versions of the specification are likely to expand this coverage.
60
60
<section >
61
61
### Goals
62
62
63
- 1 . Compromise of the third-party service should not automatically mean
63
+ 1 . Compromise of a third-party service should not automatically mean
64
64
compromise of every site which includes its scripts. Content authors
65
65
will have a mechanism by which they can specify expectations for
66
66
content they load, meaning for example that they could load a
@@ -243,7 +243,7 @@ request's [integrity metadata][], and MAY support additional hash functions.
243
243
#### Agility
244
244
245
245
Multiple sets of [ integrity metadata] [ ] may be associated with a single
246
- resource in order to provide agility in the face of future discoveries.
246
+ resource in order to provide agility in the face of future cryptographic discoveries.
247
247
For example, the resource described in the previous section may be described
248
248
by either of the following hash expressions:
249
249
@@ -264,8 +264,8 @@ set][get-the-strongest]" algorithms).
264
264
265
265
When a hash function is determined to be insecure, user agents SHOULD deprecate
266
266
and eventually remove support for integrity validation using that hash
267
- function. User agents MAY check the validity of hashes which use a deprecated
268
- function.
267
+ function. User agents MAY check the validity of responses using a digest based on
268
+ a deprecated function.
269
269
270
270
To allow authors to switch to stronger hash functions without being held back by older
271
271
user agents, validation using unsupported hash functions acts like no integrity value
@@ -277,7 +277,7 @@ stronger hash functions as they become available.
277
277
<section >
278
278
#### Priority
279
279
280
- User agents must provide a mechanism of determining the relative priority of two
280
+ User agents must provide a mechanism for determining the relative priority of two
281
281
hash functions and return the empty string if the priority is equal. That is, if
282
282
a user agent implemented a function like <dfn >getPrioritizedHashFunction(a,
283
283
b)</dfn > it would return the hash function the user agent considers the most
@@ -329,12 +329,12 @@ resources accessed over a `file` scheme URL are unlikely to be
329
329
eligible for integrity checks.
330
330
{:.note}
331
331
332
- One should note that being a [ secure document] [ ] (e.g. a document delivered
332
+ One should note that being a [ secure document] [ ] (e.g., a document delivered
333
333
over HTTPS) is not necessary for the use of integrity validation. Because
334
334
resource integrity is only an application level security tool, and it does not
335
335
change the security state of the user agent, a [ secure document] is
336
- unnecessary. However, if integrity is used in other than a [ secure document] [ ] (e.g.
337
- a document delivered over HTTP), authors should be aware that the integrity
336
+ unnecessary. However, if integrity is used in something other than a [ secure document] [ ]
337
+ (e.g., a document delivered over HTTP), authors should be aware that the integrity
338
338
provides <em >no security guarantees at all</em >. For this reason, authors should
339
339
only deliver integrity metadata on a [ potentially secure origin] [ ] . See
340
340
[ Non-secure contexts remain non-secure] [ ] for more discussion.
@@ -354,7 +354,7 @@ The following algorithm details these restrictions:
354
354
<var >resource</var >'s origin, return ` true ` .
355
355
4 . Return ` false ` .
356
356
357
- Step 3 returns ` true ` if the fetch was a CORS-enabled request. If the
357
+ Step 2 returns ` true ` if the fetch was a CORS-enabled request. If the
358
358
fetch failed the CORS checks, it won't be available to us for integrity
359
359
checking because it won't have loaded successfully.
360
360
{:.note}
@@ -600,7 +600,7 @@ integrity check <em>and</em> MUST return a network error, as described in
600
600
[ Modifications to Fetch] [ ] .
601
601
602
602
On a failed integrity check, an <code >error</code > event is thrown. Developers
603
- wishing to provide a canonical fallback resource (e.g. a resource not served
603
+ wishing to provide a canonical fallback resource (e.g., a resource not served
604
604
from a CDN, perhaps from a secondary, trusted, but slower source) can catch this
605
605
<code >error</code > event and provide an appropriate handler to replace the
606
606
failed resource with a different one.
@@ -679,8 +679,8 @@ with a value of [`no-transform`][notransform].
679
679
<section >
680
680
### Non-secure contexts remain non-secure
681
681
682
- [ Integrity metadata] [ ] delivered to a context that is not a [ secure context] ,
683
- such as an only protects an origin against a compromise of the
682
+ [ Integrity metadata] [ ] delivered by a context that is not a [ secure context] ,
683
+ such as an HTTP page, only protects an origin against a compromise of the
684
684
server where an external resources is hosted. Network attackers can alter the
685
685
digest in-flight (or remove it entirely, or do absolutely anything else to the
686
686
document), just as they could alter the response the hash is meant to validate.
@@ -722,7 +722,7 @@ logged into a particular service.
722
722
Moreover, attackers can brute-force specific values in an otherwise
723
723
static resource: consider a JSON response that looks like this:
724
724
725
- {'status': 'authenticated', 'username': 'Stephan Falken '}
725
+ {'status': 'authenticated', 'username': 'admin '}
726
726
{:.example}
727
727
728
728
An attacker can precompute hashes for the response with a variety of
@@ -740,8 +740,9 @@ Much of the content here is inspired heavily by Gervase
740
740
Markham's [ Link Fingerprints] [ ] concept, as well as WHATWG's [ Link Hashes] [ ] .
741
741
742
742
A special thanks to Mike West of Google, Inc. for his invaluable contributions
743
- to the initial version of this spec. Additonally, Brad Hill, Anne van Kesteren, Mark Nottingham,
744
- Dan Veditz, Eduardo Vela, Tanvi Vyas, and Michal Zalewski provided invaluable feedback.
743
+ to the initial version of this spec. Additonally, Brad Hill, Anne van Kesteren,
744
+ Jonathan Kingston, Mark Nottingham, Dan Veditz, Eduardo Vela, Tanvi Vyas, and
745
+ Michal Zalewski provided invaluable feedback.
745
746
746
747
747
748
[ Link Fingerprints ] : http://www.gerv.net/security/link-fingerprints/
0 commit comments