Skip to content

Commit 92cb36e

Browse files
authored
Add files via upload
1 parent 990af82 commit 92cb36e

File tree

1 file changed

+113
-71
lines changed

1 file changed

+113
-71
lines changed

spec.bs

+113-71
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ Title: Device Bound Session Credentials
33
Shortname: dbsc
44
Level: 1
55
Indent: 2
6-
Status: ED
7-
TR: https://www.w3.org/TR/dbsc/
8-
Group: WebAppSec
6+
Status: CG-DRAFT
7+
Group: WICG
98
URL: https://wicg.github.io/dbsc/
109
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.
1211
Repository: https://github.com/WICG/dbsc/
1312
Markup Shorthands: css no, markdown yes
1413
Mailing List:
@@ -66,59 +65,76 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
6665
leaked by this protocol.
6766

6867
<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:
6970

7071
<h4 id="example-signin">Signed in session</h4>
71-
<div class="example">
72+
<div class="example" id="1">
7273
A user logs in to his social account, to protect the user's private data the
7374
site protects his logged in session wwith a DBSC session. If the user tries to
7475
log with the same cookie file on a different device, the site can detect and
7576
refuse this as an unathorized user.
7677
</div>
7778

7879
<h4 id="example-device-integrity">Device integrity</h4>
79-
<div class="example">
80+
<div class="example" id="2">
8081
A commercial site has different ways of detecting unahtorized log-in attempts.
8182
A DBSC session on device could be used to see which users has logged on to
8283
this device before.
8384
</div>
8485

8586
<h4 id="example-device-reputation">Device reputation</h4>
86-
<div class="example">
87+
<div class="example" id="3">
8788
A payment company hosted at site `payment.example` could create a session
8889
bound to when users visit commercial site `shopping.example`. It could track
8990
the reliability of the device over time to decide how likely a transaction is
9091
legitimate.
9192
</div>
9293

9394
<h4 id="example-enterprise-sso">Enterprise example</h4>
94-
<div class="example">
95+
<div class="example" id="4">
9596
Describe some enterprise scenario
9697
</div>
9798

9899
<h4 id="example-enterprise-continuity">Enterprise example</h4>
99-
<div class="example">
100+
<div class="example" id="5">
100101
In an enterprise scenario, the user session can be attested to be bound to the
101102
same TPM as a the device owner has in inventory management.
102103
</div>
104+
</section>
103105

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.
111119

112120
<h3 id="non-goals">Non-goals</h3>
113121
DBSC will not prevent temporary access to the browser session while the
114122
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.
118134
</section>
119135

120136
<section>
121-
<h2 id="privacy">Privacy</h2>
137+
<h2 id="privacy-considerations">Privacy Considerations</h2>
122138
The goal of the DBSC protocol is to introduce no additional surface for user
123139
tracking: implementing this API (for a browser) or enabling it (for a website)
124140
should not entail any significant user privacy tradeoffs.
@@ -138,7 +154,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
138154
to detect that different sessions are from the same device unless the user
139155
allows this by policy.
140156

141-
<h3 id="privacy-cookies">Cookies and privacy</h3>
157+
<h3 id="privacy-cookies">Cookies considerations</h3>
142158
Cross-site/cross-origin data leakage: It should be impossible for a site to
143159
use this API to circumvent the same origin policy, 3P cookie policies, etc.
144160

@@ -149,6 +165,28 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
149165
settings, applied policies or user agent implementation details, neither would
150166
any of the DBSC heuristics. This ensures no new privacy behavior due to
151167
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>
152190
</section>
153191

154192
<section>
@@ -227,62 +265,66 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
227265
</section>
228266

229267
<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>
245286

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>
271313

272314
<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}
274316
</section>
275317

276318
<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}
278320
</section>
279321

280322
<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}
282324
</section>
283325

284326
<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}
286328
</section>
287329
</section>
288330

@@ -331,7 +373,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
331373
Any other parameters SHOULD be ignored.
332374
</section>
333375

334-
<div class="example">
376+
<div class="example" id="6">
335377
Some examples of [:Sec-Session-Registration:] from
336378
https://example.com/login.html:
337379

@@ -382,7 +424,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
382424
to be signed with a new challenge before a session id has been assigned.
383425
In this case the session ID is optional.
384426

385-
<div class="example">
427+
<div class="example" id="7">
386428
Some examples of [:Sec-Session-Challenge:] from
387429
https://example.com/login.html:
388430

@@ -421,7 +463,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
421463
This string MUST only contain the [=DBSC proof=] JWT. Any parameters SHOULD be
422464
ignored.
423465

424-
<div class="example">
466+
<div class="example" id="8">
425467
```html
426468
POST example.com/refresh
427469
Sec-Session-Response: "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRic2Mrand0In0.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL3JlZyIsImp0aSI6ImN2IiwiaWF0IjoiMTcyNTU3OTA1NSIsImp3ayI6eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6IjZfR0Iydm9RMHFyb01oNk9sREZDRlNfU0pyaVFpMVBUdnZCT2hHWjNiSEkiLCJ5IjoiSWVnT0pVTHlFN1N4SF9DZDFLQ0VSN2xXQnZHRkhRLWgweHlqelVqRUlXRSJ9LCJhdXRob3JpemF0aW9uIjoiYWMifQ.6Fb_vVBDmfNghQiBmIGe8o7tBfYPbPCywhQruP0vIhxgmcJmuNTaMHeVn_M8ZnOm1_bzIitbZqCWEn-1Qzmtyw"
@@ -439,7 +481,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
439481
This string MUST only contain the session identifier. Any paramters SHOULD be
440482
ignored.
441483

442-
<div class="example">
484+
<div class="example" id="9">
443485
```html
444486
POST example.com/refresh
445487
Sec-Session-Response: "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRic2Mrand0In0.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL3JlZyIsImp0aSI6ImN2IiwiaWF0IjoiMTcyNTU3OTA1NSIsImp3ayI6eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6IjZfR0Iydm9RMHFyb01oNk9sREZDRlNfU0pyaVFpMVBUdnZCT2hHWjNiSEkiLCJ5IjoiSWVnT0pVTHlFN1N4SF9DZDFLQ0VSN2xXQnZHRkhRLWgweHlqelVqRUlXRSJ9LCJhdXRob3JpemF0aW9uIjoiYWMifQ.6Fb_vVBDmfNghQiBmIGe8o7tBfYPbPCywhQruP0vIhxgmcJmuNTaMHeVn_M8ZnOm1_bzIitbZqCWEn-1Qzmtyw"
@@ -484,7 +526,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
484526
This key is OPTIONAL, and if not present a value of true is default.
485527
</dl>
486528

487-
<div class="example">
529+
<div class="example" id="10">
488530
```json
489531
{
490532
"session_identifier": "session_id",
@@ -559,7 +601,7 @@ spec: RFC8941; urlPrefix: https://datatracker.ietf.org/doc/html/rfc8941#
559601
MANDATORY for clients to add the claim in the [=DBSC proof=].
560602
</dl>
561603

562-
<div class="example">
604+
<div class="example" id="11">
563605
An example [=DBSC proof=] sent to https://example.com/reg:
564606

565607
```json

0 commit comments

Comments
 (0)