1. Introduction
This section is non-normative.
The Web Environment Integrity API allows user agents to request attester verdicts from an attester that can be used to verify the integrity of the web environment. These verdicts are piped to a relying party where they are validated for authenticity.
Web Environment Integrity is best suited for detecting deceptive web environments.
1.1. Motivations
This section is non-normative.
Users often depend on websites being able to establish the trustworthiness of the web environment. When users are playing online games for instance, they are trusting that other users are not cheating. Or when they are browsing social media websites, they are trusting that other users are not faking engagement to make posts popular.
Websites currently need to establish this trust relationship without any support from user agents. This can result in websites collecting signals that can be used to fingerprint users.
Web Environment Integrity is being proposed as a privacy preserving API to provide low entropy trust signals for the web environment. This API relies on user agents having access to an attester.
1.2. Examples
// getEnvironmentIntegrity expects a "content binding" of the request you are // about to make. The content binding protects against this information being // used for a different request. // The contentBinding will be concatenated with top-level domain name and hashed // before it is sent to the attester. const contentBinding= "/someRequestPath?requestID=xxxx" + "Any other data needed for a request-specific contentBinding..." ; const attestation= await navigator. getEnvironmentIntegrity( contentBinding); console. log( attestation. encode()); "base-64 encoding of the attestation payload and signature approx 500 bytes; see below for details" // More on attestation validation below const response= await fetch( `/someRequest?requestID=xxxx&attested= ${ attestation. encode() } ` ); // Do something with this ...
2. Key terms
The web environment is defined as TODO
The content binding is defined as TODO
Entropy in this specification refers to Shannon entropy. This is the amount information conveyed.
3. Attesters
The relying party is defined as any party that relies on the Web Environment Integrity API outside of the user agent.
4. Infrastructure
4.1. Attesters
The term attester refers to a third party capable of returning an attester verdict.
User agents MUST have an attester connection to an attester in order to use Web Environment Integrity.
The user agent SHOULD use separate attester connections if the attester connection stores state in the attester verdict that can be used for cross site tracking.
4.1.1. Attester Connection
The attester connection is an abstract concept representing the channel through which the user agent can communicate to an attester. The user agent uses the attester connection to request new attester verdicts.
The attester connection MUST use a content binding to create a new attester verdict.
4.1.2. Attester Verdict
The attester verdict is an abstract concept that refers to the response from attester. It reports how much an attester trusts the web environment the user agent is executing in.
The attester verdict consists of:
-
A raw response (a COSE [RFC9053] signed CBOR [RFC8949] stored in an
ArrayBuffer
)
4.2. Browser Acceptance Criteria
Todo
5. Web Environment Integrity API
5.1. Extensions to Navigator
[Exposed =Window ]partial interface Navigator { [SecureContext ]Promise <EnvironmentIntegrity >getEnvironmentIntegrity (DOMString ); };
contentBinding
5.1.1. getEnvironmentIntegrity()
The getEnvironmentIntegrity(contentBinding)
method, when invoked, runs these steps:
-
Let promise be a new promise
-
Run the following steps in parallel:
-
Let hashedCB be the digest [SHA-256](contentBinding + ";" + origin)
-
Set attesterVerdict to a new attester verdict from the attesterConnection using the hashedCB. If this fails then:
-
Reject promise with a "
UnknownError
"DOMException
-
Abort these steps
-
-
Let environmentIntegrity be a new
EnvironmentIntegrity
with:-
attestationToken
set to the raw response in the attesterVerdict
-
-
Resolve promise with environmentIntegrity
-
-
Return promise
5.2. EnvironmentIntegrity
[Exposed =Window ]interface {
EnvironmentIntegrity readonly attribute ArrayBuffer ;
attestationToken DOMString ();
encode object (); };
toJSON
- attestationToken
-
The attestation token is a COSE [RFC9053] signed CBOR [RFC8949] object as an
ArrayBuffer
from the attester. - encode()
-
The encode method will return a Base64 string representation of the attestation token.
- toJSON()
-
The toJSON method returns a human readable JSON representation of the attestation token. It will first decode the CBOR object. Useful for local debugging.
6. Security and privacy considerations
6.1. Security considerations
6.1.1. Secure context only
Web environment integrity MUST only be enabled in a secure context. This is to ensure that the website is not spoofed.
Todo
6.2. Privacy considerations
Todo