diff --git a/index.bs b/index.bs index bebaab3..06e337f 100644 --- a/index.bs +++ b/index.bs @@ -183,7 +183,7 @@ spec: SHA2; urlPrefix: http://csrc.nist.gov/publications/fips/fips180-4/fips-180 - * A user agent wishes to ensure that JavaScript code running in high-privilege HTML + * A user agent wishes to ensure that JavaScript code running in high-privilege HTML contexts (for example, a browser's New Tab page) aren't manipulated before display. Integrity metadata mitigates the risk that altered JavaScript will run in these pages' high-privilege contexts. @@ -199,10 +199,6 @@ spec: SHA2; urlPrefix: http://csrc.nist.gov/publications/fips/fips180-4/fips-180 The terms [=/origin=] and [=same origin=] are defined in HTML. [[!HTML]] - The representation data of a resource is defined by - Section 3 - of RFC 7231. [[!RFC7231]] - A base64 encoding is defined in Section 4 of RFC 4648. [[!RFC4648]] @@ -346,61 +342,12 @@ spec: SHA2; urlPrefix: http://csrc.nist.gov/publications/fips/fips180-4/fips-180 ## Response verification algorithms ## {#verification-algorithms} - ### Apply |algorithm| to |response| ### {#apply-algorithm-to-response} + ### Apply |algorithm| to |bytes| ### {#apply-algorithm-to-response} - 1. Let |result| be the result of [[#apply-algorithm-to-response]] - to the representation data without any content-codings - applied, except when the user agent intends to consume the content with - content-codings applied. In the latter case, let |result| be - the result of applying |algorithm| to the representation data. + 1. Let |result| be the result of applying |algorithm| to |bytes|. 2. Let |encodedResult| be result of base64 encoding |result|. 3. Return |encodedResult|. - ### Is |response| eligible for integrity validation? ### {#is-response-eligible} - - In order to mitigate an attacker's ability to read data cross-origin by - brute-forcing values via integrity checks, responses are only eligible for such - checks if they are same-origin or are the result of explicit access granted to - the loading origin via Cross Origin Resource Sharing [[!Fetch]]. - - Note: As noted in - RFC6454, section 4, - some user agents use - globally unique identifiers for each file URI. This means that - resources accessed over a `file` scheme URL are unlikely to be - eligible for integrity checks. - - Note: Being in a Secure Context (e.g., a document delivered over HTTPS) is not - necessary for the use of integrity validation. Because resource integrity is - only an application level security tool, and it does not change the security - state of the user agent, a Secure Context is unnecessary. However, if integrity - is used in something other than a Secure Context (e.g., a document delivered - over HTTP), authors are reminded that the integrity provides no security - guarantees at all. For this reason, authors are encouraged to only deliver - integrity metadata in a Secure Context. See [[#non-secure-contexts]] for - more discussion. - - The following algorithm details these restrictions: - - 1. Let |response| be the response that results from - fetching the |resource|. - 2. If the |response| type is `basic`, - `cors` or `default`, return `true`. - 3. Return `false`. - -