@@ -3,12 +3,11 @@ Title: Device Bound Session Credentials
3
3
Shortname : dbsc
4
4
Level : 1
5
5
Indent : 2
6
- Status : ED
7
- TR : https://www.w3.org/TR/dbsc/
8
- Group : WebAppSec
6
+ Status : CG-DRAFT
7
+ Group : WICG
9
8
URL : https://wicg.github.io/dbsc/
10
9
Editor : Kristian Monsen 76841, Google, [email protected]
11
- Abstract : The Device Bound Sessions Credentials (DBSC) aims to prevent hijacking via cookie theft by building a protocol and infrastructure that allows a user agent to assert possession of a securely-stored private key. DBSC is a Web API and protocol between user agents and servers to achieve this binding.
10
+ Abstract : The Device Bound Sessions Credentials (DBSC) aims to prevent hijacking via cookie theft by building a protocol and infrastructure that allows a user agent to assert possession of a securely-stored private key. DBSC is a Web API and a protocol between user agents and servers to achieve this binding.
12
11
Repository : https://github.com/WICG/dbsc/
13
12
Markup Shorthands : css no, markdown yes
14
13
Mailing List :
@@ -66,59 +65,76 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
66
65
leaked by this protocol.
67
66
68
67
<h3 id="examples">Examples</h3>
68
+ Device Bound Session Credentials are designed to make users more secure in
69
+ different situations. Some of the use cases of DBSC are:
69
70
70
71
<h4 id="example-signin">Signed in session</h4>
71
- <div class="example">
72
+ <div class="example" id="1" >
72
73
A user logs in to his social account, to protect the user's private data the
73
74
site protects his logged in session wwith a DBSC session. If the user tries to
74
75
log with the same cookie file on a different device, the site can detect and
75
76
refuse this as an unathorized user.
76
77
</div>
77
78
78
79
<h4 id="example-device-integrity">Device integrity</h4>
79
- <div class="example">
80
+ <div class="example" id="2" >
80
81
A commercial site has different ways of detecting unahtorized log-in attempts.
81
82
A DBSC session on device could be used to see which users has logged on to
82
83
this device before.
83
84
</div>
84
85
85
86
<h4 id="example-device-reputation">Device reputation</h4>
86
- <div class="example">
87
+ <div class="example" id="3" >
87
88
A payment company hosted at site `payment.example` could create a session
88
89
bound to when users visit commercial site `shopping.example`. It could track
89
90
the reliability of the device over time to decide how likely a transaction is
90
91
legitimate.
91
92
</div>
92
93
93
94
<h4 id="example-enterprise-sso">Enterprise example</h4>
94
- <div class="example">
95
+ <div class="example" id="4" >
95
96
Describe some enterprise scenario
96
97
</div>
97
98
98
99
<h4 id="example-enterprise-continuity">Enterprise example</h4>
99
- <div class="example">
100
+ <div class="example" id="5" >
100
101
In an enterprise scenario, the user session can be attested to be bound to the
101
102
same TPM as a the device owner has in inventory management.
102
103
</div>
104
+ </section>
103
105
104
- <h3 id="goals">Goals</h3>
105
- Reduce session theft by offering an alternative to long-lived cookie bearer
106
- tokens, that allows session authentication that is bound to the user's device.
107
- This makes the internet safer for users in that it is less likely their
108
- identity is abused, since malware is forced to act locally and thus becomes
109
- easier to detect and mitigate. At the same time the goal is to disrupt the
110
- cookie theft ecosystem and force it to adapt to new protections.
106
+ <section>
107
+ <h2 id="privacy">Security Considerations</h2>
108
+ The goal of DBSC is to reduce session theft by offering an alternative to
109
+ long-lived cookie bearer tokens, that allows session authentication that is
110
+ bound to the user's device. This makes the internet safer for users in that it
111
+ is less likely their identity is abused, as malware is forced to act
112
+ locally and thus becomes easier to detect and mitigate. At the same time the
113
+ goal is to disrupt the cookie theft ecosystem and force it to adapt to new
114
+ protections long term.
115
+
116
+ As long as the session is valid a host can know with cryptographic certainty
117
+ that it is on the same device as the session was originally bound to if the
118
+ session was registered to a secure device.
111
119
112
120
<h3 id="non-goals">Non-goals</h3>
113
121
DBSC will not prevent temporary access to the browser session while the
114
122
attacker is resident on the user's device. The private key should be stored as
115
- safe as modern desktop operating systems allow, preventing exfiltration of the
116
- session private key, but the signing capability will still be available for
117
- any program running as the user on the user's device.
123
+ safe as modern operating systems allow, preventing exfiltration of the session
124
+ private key, but the signing capability will still be available for any
125
+ program running as the user on the user's device.
126
+
127
+ DBSC will also not prevent an attack if the attacker is replacing or injecting
128
+ into the user agent at the time of session registration as the attacker can
129
+ bind the session either to keys that are not TPM bound, or to a TPM that the
130
+ attacker controls permanently.
131
+
132
+ DBSC is not designed to give hosts any sort of guarantee about the device a
133
+ session is registered to, or the state of this device.
118
134
</section>
119
135
120
136
<section>
121
- <h2 id="privacy">Privacy</h2>
137
+ <h2 id="privacy-considerations ">Privacy Considerations </h2>
122
138
The goal of the DBSC protocol is to introduce no additional surface for user
123
139
tracking: implementing this API (for a browser) or enabling it (for a website)
124
140
should not entail any significant user privacy tradeoffs.
@@ -138,7 +154,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
138
154
to detect that different sessions are from the same device unless the user
139
155
allows this by policy.
140
156
141
- <h3 id="privacy-cookies">Cookies and privacy </h3>
157
+ <h3 id="privacy-cookies">Cookies considerations </h3>
142
158
Cross-site/cross-origin data leakage: It should be impossible for a site to
143
159
use this API to circumvent the same origin policy, 3P cookie policies, etc.
144
160
@@ -149,6 +165,28 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
149
165
settings, applied policies or user agent implementation details, neither would
150
166
any of the DBSC heuristics. This ensures no new privacy behavior due to
151
167
implementing DBSC.
168
+
169
+ <h3 id="privacy-side-channel-leak">Current timing side channel leak</h3>
170
+ If third party cookies are enabled it is possible for an attacker to leak
171
+ whether or not a user is authenticated by measuring how long the request takes
172
+ as the refresh is quite slow, partially due to the latency of TPM operations.
173
+
174
+ This only applies if the site to be leaked about has enabled third party
175
+ cookies, if an attacker does have third-party cookie access there are often
176
+ attackes and leaks.
177
+
178
+ This is not a very reliable leak as the user needs to have a session on the
179
+ site that is currently out of date and would need to be refreshed. The leak
180
+ cannot be trivially repeated as the first request will renew the session that
181
+ would likely not expire again for some time.
182
+
183
+ It is important websites think about this privacy leak before adopting DBSC,
184
+ even more so if the plan is to use sessions with third party cookies.
185
+ </section>
186
+
187
+ <section>
188
+ <h2 id="alternatives">Alternatives considered</h2>
189
+ <h3 id="alternatives-webauthn">WebAuthn and silent mediation</h3>
152
190
</section>
153
191
154
192
<section>
@@ -227,62 +265,66 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
227
265
</section>
228
266
229
267
<section>
230
- <h2 id="algorithm">Algorithms</h2>
231
- <section>
232
- ## <dfn export abstract-op id="identify-session">Identify session</dfn> ## {#algo-identify-session}
233
-
234
- <div class="algorithm" data-algorithm="identify-session">
235
- Given a [=url=] and [=device bound session/session identifier=]
236
- (|session identifier|), this algorithm returns a [=device bound session=]
237
- or null if no such session exists.
238
-
239
- 1. Let |site| be the [=host/registrable domain=] of the [=url=]
240
- 1. Let |domain sessions| be [=registrable domain sessions=] [|site|] as a
241
- [=/session by id=]
242
- 1. Return |domain sessions|[|session identifier|]
243
- </div>
244
- </section>
268
+ # <dfn export id="algorithms">Algorithms</dfn> # {#algorithm}
269
+ ## Identify session ## {#algo-identify-session}
270
+ <div class="algorithm" data-algorithm="identify-session">
271
+ This algorithm describes how to
272
+ <dfn export dfn-for="algorithms">identify a session</dfn> out of all the
273
+ sessions that exist on a user agent. The
274
+ [=device bound session/session identifier=] is unique within a
275
+ [=host/registrable domain=] .
276
+
277
+ Given a [=url=] and [=device bound session/session identifier=]
278
+ (|session identifier|), this algorithm returns a [=device bound session=] or
279
+ null if no such session exists.
280
+
281
+ 1. Let |site| be the [=host/registrable domain=] of the [=url=]
282
+ 1. Let |domain sessions| be [=registrable domain sessions=] [|site|] as a
283
+ [=/session by id=]
284
+ 1. Return |domain sessions|[|session identifier|]
285
+ </div>
245
286
246
- <section>
247
- ## <dfn export abstract-op id="process-challenge">Process challenge</dfn> ## {#algo-process-challenge}
248
-
249
- <div class="algorithm" data-algorithm="process-challenge">
250
- Given a [=response=] (|response|), a [=registrable domain sessions=] ,
251
- this algorithm updates the [=device bound session/cached challenge=] for a
252
- [=device bound session=] , or immediatly resends the [=DBSC proof=] signed
253
- with the new challenge.
254
-
255
- 1. Let |header name| be "<code> Sec-Session-Challenge</code> ".
256
- 1. Let |challenge list| be the result of executing <a>get a structured
257
- field value</a> given |header name| and "list" from |response|’s
258
- [=response/header list=] .
259
- 1. [=list/For each=] |challenge entry| of |challenge list|:
260
- 1. Get the new |challenge| and |session id| from |challenge entry| as
261
- described in [:Sec-Session-Challenge:] .
262
- 1. If [=response/status=] is 401, resend this request as is with updated
263
- |challenge| in [=DBSC proof=]
264
- 1. Otherwise:
265
- 1. Identify session as described in [[#algo-identify-session]] given
266
- |response| and |session id| and store as |session object|.
267
- 1. Store |challenge| in |session object| to be used next time a
268
- [=DBSC proof=] is to be sent from this [=device bound session=] .
269
- </div>
270
- </section>
287
+ ## Process challenge ## {#algo-process-challenge}
288
+ <div class="algorithm" data-algorithm="process-challenge">
289
+ This algorithm describes how to
290
+ <dfn export dfn-for="algorithms">process a challenge</dfn> received in an
291
+ HTTP header.
292
+
293
+ Given a [=response=] (|response|), a [=registrable domain sessions=] , this
294
+ algorithm updates the [=device bound session/cached challenge=] for a
295
+ [=device bound session=] , or immediatly resends the [=DBSC proof=] signed
296
+ with the new challenge.
297
+
298
+ 1. Let |header name| be "<code> Sec-Session-Challenge</code> ".
299
+ 1. Let |challenge list| be the result of executing <a>get a structured
300
+ field value</a> given |header name| and "list" from |response|’s
301
+ [=response/header list=] .
302
+ 1. [=list/For each=] |challenge entry| of |challenge list|:
303
+ 1. Get the new |challenge| and |session id| from |challenge entry| as
304
+ described in [:Sec-Session-Challenge:] .
305
+ 1. If [=response/status=] is 401, resend this request as is with updated
306
+ |challenge| in [=DBSC proof=]
307
+ 1. Otherwise:
308
+ 1. Identify session as described in [=identify a session=] given
309
+ |response| and |session id| and store as |session object|.
310
+ 1. Store |challenge| in |session object| to be used next time a
311
+ [=DBSC proof=] is to be sent from this [=device bound session=] .
312
+ </div>
271
313
272
314
<section>
273
- ## <dfn export abstract-op id="refresh-session">Refreshing an existing session</dfn> ## {#algo-refresh-session}
315
+ ## <dfn export id="refresh-session">Refreshing an existing session</dfn> ## {#algo-refresh-session}
274
316
</section>
275
317
276
318
<section>
277
- ## <dfn export abstract-op id="create-session">Create a new session</dfn> ## {#algo-create-session}
319
+ ## <dfn export id="create-session">Create a new session</dfn> ## {#algo-create-session}
278
320
</section>
279
321
280
322
<section>
281
- ## <dfn export abstract-op id="close-session">Close a session</dfn> ## {#algo-close-session}
323
+ ## <dfn export id="close-session">Close a session</dfn> ## {#algo-close-session}
282
324
</section>
283
325
284
326
<section>
285
- ## <dfn export abstract-op id="fetch-integration">Fetch Integration</dfn> ## {#algo-fetch-integration}
327
+ ## <dfn export id="fetch-integration">Fetch Integration</dfn> ## {#algo-fetch-integration}
286
328
</section>
287
329
</section>
288
330
@@ -331,7 +373,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
331
373
Any other parameters SHOULD be ignored.
332
374
</section>
333
375
334
- <div class="example">
376
+ <div class="example" id="6" >
335
377
Some examples of [:Sec-Session-Registration:] from
336
378
https://example.com/login.html:
337
379
@@ -382,7 +424,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
382
424
to be signed with a new challenge before a session id has been assigned.
383
425
In this case the session ID is optional.
384
426
385
- <div class="example">
427
+ <div class="example" id="7" >
386
428
Some examples of [:Sec-Session-Challenge:] from
387
429
https://example.com/login.html:
388
430
@@ -421,7 +463,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
421
463
This string MUST only contain the [=DBSC proof=] JWT. Any parameters SHOULD be
422
464
ignored.
423
465
424
- <div class="example">
466
+ <div class="example" id="8" >
425
467
```html
426
468
POST example.com/refresh
427
469
Sec-Session-Response: "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRic2Mrand0In0.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL3JlZyIsImp0aSI6ImN2IiwiaWF0IjoiMTcyNTU3OTA1NSIsImp3ayI6eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6IjZfR0Iydm9RMHFyb01oNk9sREZDRlNfU0pyaVFpMVBUdnZCT2hHWjNiSEkiLCJ5IjoiSWVnT0pVTHlFN1N4SF9DZDFLQ0VSN2xXQnZHRkhRLWgweHlqelVqRUlXRSJ9LCJhdXRob3JpemF0aW9uIjoiYWMifQ.6Fb_vVBDmfNghQiBmIGe8o7tBfYPbPCywhQruP0vIhxgmcJmuNTaMHeVn_M8ZnOm1_bzIitbZqCWEn-1Qzmtyw"
@@ -439,7 +481,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
439
481
This string MUST only contain the session identifier. Any paramters SHOULD be
440
482
ignored.
441
483
442
- <div class="example">
484
+ <div class="example" id="9" >
443
485
```html
444
486
POST example.com/refresh
445
487
Sec-Session-Response: "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRic2Mrand0In0.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL3JlZyIsImp0aSI6ImN2IiwiaWF0IjoiMTcyNTU3OTA1NSIsImp3ayI6eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6IjZfR0Iydm9RMHFyb01oNk9sREZDRlNfU0pyaVFpMVBUdnZCT2hHWjNiSEkiLCJ5IjoiSWVnT0pVTHlFN1N4SF9DZDFLQ0VSN2xXQnZHRkhRLWgweHlqelVqRUlXRSJ9LCJhdXRob3JpemF0aW9uIjoiYWMifQ.6Fb_vVBDmfNghQiBmIGe8o7tBfYPbPCywhQruP0vIhxgmcJmuNTaMHeVn_M8ZnOm1_bzIitbZqCWEn-1Qzmtyw"
@@ -484,7 +526,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
484
526
This key is OPTIONAL, and if not present a value of true is default.
485
527
</dl>
486
528
487
- <div class="example">
529
+ <div class="example" id="10" >
488
530
```json
489
531
{
490
532
"session_identifier": "session_id",
@@ -559,7 +601,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
559
601
MANDATORY for clients to add the claim in the [=DBSC proof=] .
560
602
</dl>
561
603
562
- <div class="example">
604
+ <div class="example" id="11" >
563
605
An example [=DBSC proof=] sent to https://example.com/reg:
564
606
565
607
```json
0 commit comments