Skip to content

Commit bcbb500

Browse files
committed
Merge remote-tracking branch 'upstream/main' into dbsc-e
2 parents 18c44e5 + beb7c6d commit bcbb500

File tree

4 files changed

+785
-16
lines changed

4 files changed

+785
-16
lines changed

.github/workflows/spec-update.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Spec Update
2+
on:
3+
workflow_dispatch: {}
4+
pull_request: {}
5+
push:
6+
branches: [main]
7+
jobs:
8+
main:
9+
name: Build, Validate and Deploy
10+
runs-on: ubuntu-20.04
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: w3c/spec-prod@v2
16+
with:
17+
TOOLCHAIN: bikeshed
18+
19+
# Modify as appropriate
20+
GH_PAGES_BRANCH: gh-pages
21+
22+
# if your doc isn't in the root folder,
23+
# or Bikeshed otherwise can't find it:
24+
SOURCE: spec.bs
25+
26+
# output filename defaults to your input
27+
# with .html extension instead,
28+
# but if you want to customize it:
29+
DESTINATION: index.html

README.md

+41-15
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ DBSC(E) removes the vulnerability DBSC has, where a malware, if already present
9393

9494
## High level overview
9595
![High level diagram](reg_and_refresh.svg)
96-
[Link to editable diagram](https://sequencediagram.org/index.html#initialData=A4QwTgLglgxloDsIAIBEAVACgWVckAzshAFCiSzwhJoBCYA9gO4ECmYehyARmeNHEQpUAZXYA3dpyJMScktwC0APiYAuZASgBzBIqgJkAMwA2zEkxXcNAJgAMd5EwD0W3awAm+wzAZJWSAA0yGCsBMB+bMgGMCYArh5hyAAWrCCJYMQMmhD8mqwwcaH5BFp+AHTIyAA6CAASaRkaqKIFimKlUH6KAEqs2lAEEGAg0H4abJ1+APpQiUhQRlDsALzl68EwySAmJgHarGvrLbUAFFs7ewgHIawAjnFQoR7GDJnAYFDio6zIANasACeyA+DAYRmQ4JBDFKYTKCAAlCQEAwIL8GJJMtYeIwWOxoggoNAfkRJvCeAYPAZtLVuIRPJDDKl0viPmEAjBW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VXIDVglsIUoTIc4oRGMdk61F+7AIWIMDtEC0aKJuHgaAA2shyA7gAui0M5eQALHYACMH4NJSYC3W0HTAoof6zAa+ysBoyGoeh0BYewqyTME+p7Es2PrAR42-IqUmcmqNq+Qj+OeiaahmhabjOraApeQ6ooai6zPuqEu37UGR00tiCCnaw51hJdn6NDdP53Q9Iu9GEEQIGw702r9xPyqT3YaPcUoeFynx-H8EQ0dG-3WC1C5hfgxmfTue4HiisQJEkBBnheuXXkQt4KQ+z4qW+H7XZDcvCnDYXAaB4F6dBsEHghSGPX4aMNZh2GpsWf0k12k35ELU7RmVQxjlKE6eMEx1xORtR3opcxZWy-NOQddXuY1s4+S4LlUX5DUkAENlD0AA)
9797
The general flow of a secure session is as follows:
9898
1. The website requests that the browser start a new session, providing an HTTP endpoint to negotiate registration parameters.
9999
1. The browser creates a device-bound key pair, and calls the registration HTTP endpoint to set up the session and register the public key.
@@ -125,16 +125,22 @@ We do not reccomend this option for most deployments, but it is possibly for tho
125125
The session start process is initiated by the server attaching a header with Sec-Session-Registration and appropriate parameters, this looks like:
126126
```http
127127
HTTP/1.1 200 OK
128-
Sec-Session-Registration: (RS256 ES256);challenge="nonce";path="StartSession"
128+
Sec-Session-Registration: (RS256 ES256);challenge="challenge_value";path="StartSession"
129129
```
130-
This is a structured header with a list of token arguments representing the allowed algorithms (possibilities are ES256 and RS256). The list have multiple string attributes, "path" is required describing the endpoint to use, "challenge" is to provide a nonce for the registration JWT. There is also an optional string attribute called authorization. There can be more than one registration on one response:
130+
This is a structured header with a list of token arguments representing the allowed algorithms (possibilities are ES256 and RS256). The list have multiple string attributes, "path" is required describing the endpoint to use, "challenge" is to provide a challenge value for the registration JWT. There is also an optional string attribute called authorization. There can be more than one registration on one response:
131131
```http
132132
HTTP/1.1 200 OK
133-
Sec-Session-Registration: (ES256 RS256);path="path1";challenge="nonce";authorization="authcode"
134-
Sec-Session-Registration: (ES256);path="path2";challenge="nonce"
133+
Sec-Session-Registration: (ES256 RS256);path="path1";challenge="challenge_value";authorization="authcode"
134+
Sec-Session-Registration: (ES256);path="path2";challenge="challenge_value"
135135
```
136136

137-
The authorization value is optional. If present, it will be sent to the registration endpoint in the `Authorization` header, and included in the registration JWT. This allows passing a bearer token that allows the server to link registration with some preceding sign in flow, as an alternative to the more traditional use of cookies. While this can also facilitate integration with some existing infrastructure, e.g. ones based on OAuth 2.0, this parameter is general and is not limited to the similarly named [Authorization Code](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.1) in OAuth 2.0.
137+
An equivalent way of writing this is:
138+
```http
139+
HTTP/1.1 200 OK
140+
Sec-Session-Registration: (ES256 RS256);path="path1";challenge="challenge_value";authorization="authcode", (ES256);path="path2";challenge="challenge_value"
141+
```
142+
143+
The authorization value is optional for servers to send, but mandatory for clients to implement. If present, it will be sent to the registration endpoint in the `Authorization` header, and included in the registration JWT. This allows passing a bearer token that allows the server to link registration with some preceding sign in flow, as an alternative to the more traditional use of cookies. While this can also facilitate integration with some existing infrastructure, e.g. ones based on OAuth 2.0, this parameter is general and is not limited to the similarly named [Authorization Code](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.1) in OAuth 2.0.
138144

139145
#### Session Registration JWT
140146
The browser responds to the session start by selecting a compatible signature algorithm and creating a device-bound private key for the new session. It then makes the following HTTP request (assuming the endpoint URL is https://auth.example.com/securesession):
@@ -149,8 +155,8 @@ Cookie: whatever_cookies_apply_to_this_request=value;
149155
Sec-Session-Response: registration JWT
150156
151157
```
152-
The JWT is signed with the newly created private key, and needs to contain the following values:
153-
```json
158+
The JWT is signed with the newly created private key, and needs to contain the following values (the public key is in the [JWK](https://datatracker.ietf.org/doc/html/rfc7517) format):
159+
```jsonc
154160
// Header
155161
{
156162
"alg": "Signature Algorithm",
@@ -159,9 +165,12 @@ The JWT is signed with the newly created private key, and needs to contain the f
159165
// Payload
160166
{
161167
"aud": "URL of this request",
162-
"jti": "nonce",
168+
"jti": "challenge_value",
163169
"iat": "timestamp",
164-
"key": "public key",
170+
"key": {
171+
"kty": "key type",
172+
"<kty-specific parameters>": "<value>",
173+
},
165174
"authorization": "<authorization_value>", // optional, only if set in registration header
166175
}
167176
```
@@ -176,7 +185,7 @@ Cache-Control: no-store
176185
Set-Cookie: auth_cookie=abcdef0123; Domain=example.com; Max-Age=600; Secure; HttpOnly;
177186
```
178187

179-
```json
188+
```jsonc
180189
{
181190
"session_identifier": "session_id",
182191
"refresh_url": "/RefreshEndpoint",
@@ -214,9 +223,12 @@ If the request is not properly authorized, the server can request a new signed r
214223

215224
```http
216225
HTTP/1.1 401
217-
Sec-Session-Challenge: challenge="nonce"
226+
Sec-Session-Challenge: "challenge_value"
218227
```
219228

229+
Where Sec-Session-Challenge header is a structured header with a list of challenge values that may specify an optional "id" parameter: "challenge_value";id="session_id".
230+
The challenge applies to the current context if "id" is not present; otherwise it applies to the specific session. The browser ignores the challenge if "id" doesn't match any session locally.
231+
220232
Subsequently, as long as the browser considers this session "active", it follows the steps above, namely by refreshing the auth_cookie whenever needed, as covered in the next section.
221233

222234
Note if multiple cookies are required, the browser returns multiple Set-Cookie headers, with corresponding entries in the "credentials" array in the response body.
@@ -243,14 +255,28 @@ In response to this the server can optionally first request a proof of possessio
243255

244256
```http
245257
HTTP/1.1 401
246-
Sec-Session-Challenge: session_identifier="session_id",challenge="nonce"
258+
Sec-Session-Challenge: "challenge_value";id="session_id"
247259
```
248260

249261
The server can also serve challenges ahead of time attached to any response as an optimization, for example:
250262
```http
251263
HTTP/1.1 XXX
252-
Sec-Session-Challenge: session_identifier="session_id",challenge="nonce"
264+
Sec-Session-Challenge: "challenge_value";id="session_id"
265+
```
266+
267+
It is also possible to send challenges to multiple sessions:
268+
```http
269+
HTTP/1.1 XXX
270+
Sec-Session-Challenge: "challenge 1";id="session 1"
271+
Sec-Session-Challenge: "challenge 2";id="session 2"
272+
```
273+
274+
This can also be formatted as:
275+
```http
276+
HTTP/1.1 XXX
277+
Sec-Session-Challenge: "challenge 1";id="session 1", "challenge 2";id="session 2"
253278
```
279+
as each challenge is a structured header item.
254280

255281
The browser replies to that response with a Sec-Session-Response header, containing a signed JWT:
256282

@@ -262,7 +288,7 @@ Sec-Session-Response: refresh JWT
262288
The JWT contains:
263289
```json
264290
{
265-
"jti": "nonce",
291+
"jti": "challenge_value",
266292
"aud": "the URL to which the Sec-Session-Response will be sent",
267293
"sub": "the session ID corresponding to the binding key",
268294
}

reg_and_refresh.svg

+1-1
Loading

0 commit comments

Comments
 (0)