dbsc-toolkit 2.9.0 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,33 +5,42 @@
5
5
  [![License](https://img.shields.io/npm/l/dbsc-toolkit.svg)](./LICENSE)
6
6
  [![Node](https://img.shields.io/node/v/dbsc-toolkit.svg)](https://nodejs.org)
7
7
 
8
- ## The problem this solves
9
-
10
- When a user logs in to your app, the server hands the browser a session cookie. From that point on, the cookie *is* the user. Every request carrying it gets treated as authenticated. That's the soft spot: if an attacker ever gets a copy of the cookie (via XSS, malware on the user's machine, a leaked log file, a misconfigured proxy), they paste it into their own browser and they *are* your user. No password prompt, no MFA, no second factor. Cookies are portable by design, and that portability is exactly what makes them stealable.
11
-
12
- ## What this library does
13
-
14
- Device Bound Session Credentials ([DBSC](https://w3c.github.io/webappsec-dbsc/)) is a new W3C standard that breaks that portability. When the user logs in, the browser generates a private cryptographic key on the user's device, inside the TPM chip on Windows, the Secure Enclave on Macs, or the Android Keystore on phones. The public half goes to your server. Every few minutes the browser proves it still has the private key by signing a fresh server-issued challenge. A copied cookie pasted into another machine has no matching key, so refresh fails and the session dies within minutes.
15
-
16
- Chromium 145+ does this natively (Chrome, Edge, Brave, Opera, Arc, Vivaldi). For browsers that don't ship DBSC yet (Firefox, Safari, older Chromium), this library also includes a Web Crypto polyfill that delivers the same protection against remote cookie theft. It activates silently after login with no biometric prompt and no user interaction. The polyfill key lives in the browser's own keystore (IndexedDB) instead of a hardware chip, so it's a notch weaker against malware running on the user's own machine, but it still defeats every remote-theft scenario.
17
-
18
- The library exposes both paths as a single `tier` string your route handlers gate on:
19
-
20
- | Browser | `tier` value | Where the private key lives |
21
- |---------|--------------|------------------------------|
22
- | Chromium 145+ (Chrome, Edge, Brave, Opera, Arc, Vivaldi) | `"dbsc"` | TPM / Secure Enclave / Android Keystore |
23
- | Firefox, Safari, older Chromium | `"bound"` | Browser's own keystore (non-extractable IndexedDB key) |
24
- | No active binding (logged out, polyfill not loaded, etc.) | `"none"` | n/a |
25
-
26
- This package is the server-side implementation: middleware for Express / Fastify / Hono / Next.js, storage adapters for memory / Redis / Postgres, and a small browser SDK that drives the polyfill on non-Chromium browsers.
27
-
28
- **New here?** Read [HOW-IT-WORKS.md](./HOW-IT-WORKS.md) for the 15-minute walk-through.
29
-
30
- ## Live demo
31
-
32
- Try it: <https://dbsc-toolkit.onrender.com/>
33
-
34
- Sign up, log in, click **Check session**. Chromium 145+ lands on `tier: "dbsc"` within a second; Firefox/Safari land on `tier: "bound"` within ~3 seconds. The demo uses a 60-second bound-cookie TTL so refresh fires fast. Open DevTools Network and watch. Source in [examples/express/](./examples/express/).
8
+ > **Stop stolen session cookies from being replayed on another device.**
9
+ >
10
+ > `dbsc-toolkit` implements W3C [Device Bound Session Credentials](https://www.w3.org/TR/dbsc/) on the server, and ships a Web Crypto polyfill so the same protection works on browsers that don't speak native DBSC yet. Native DBSC on Chromium 146+ Windows; the polyfill on every other browser. **One server, every browser, no user prompts.**
11
+ >
12
+ > Works with **Express · Fastify · Hono · Next.js · Redis · PostgreSQL**.
13
+
14
+ ## Contents
15
+
16
+ - [Install](#install)
17
+ - [Quick start](#quick-start)
18
+ - [Live demo](#live-demo)
19
+ - [Why dbsc-toolkit](#why-dbsc-toolkit)
20
+ - [Comparison](#comparison)
21
+ - [Why not JWT?](#why-not-just-use-jwt)
22
+ - [How it works](#how-it-works-the-30-second-version)
23
+ - [Who is this for?](#who-is-this-for)
24
+ - [Adding to an existing app](#adding-to-an-existing-app)
25
+ - [Protect your routes](#protect-your-routes)
26
+ - [Production checklist](#production-checklist)
27
+ - [API](#subpath-imports)
28
+ - [Going deeper](#going-deeper)
29
+
30
+ ## Why dbsc-toolkit
31
+
32
+ Native DBSC ships on Chrome 146+ for Windows users with a TPM. That's about a third of internet users. Every other DBSC implementation gives the rest of your users nothing — they remain on plain bearer cookies.
33
+
34
+ This library is among the first DBSC implementations to provide a Web Crypto fallback for browsers that don't support native DBSC. Same wire-level protection against cookie theft, same `requireProof()` guard server-side, key stored non-extractably in IndexedDB instead of a TPM. No biometric prompt, no user interaction, no checkbox.
35
+
36
+ - ✅ **Native W3C DBSC** on Chromium 146+ (TPM / Secure Enclave / Android Keystore)
37
+ - ✅ **Web Crypto polyfill** on Firefox, Safari, older Chromium — same protection, IndexedDB key
38
+ - ✅ **Express, Fastify, Hono, Next.js** adapters — all four ship in one package
39
+ - ✅ **Memory, Redis, Postgres** storage — pick one, swap with one line
40
+ - ✅ **`requireProof()`** per-request signature guard — works on every browser, body-hash defended against MITM
41
+ - ✅ **Replay cache** (v2.8+) — rejects captured-proof replay outside the timestamp window
42
+ - ✅ **Multi-subdomain** (v2.9+) — `cookieScope: "site"` for `app.example.com` + `api.example.com`
43
+ - ✅ **Apache 2.0** — read every line before you ship it
35
44
 
36
45
  ## Install
37
46
 
@@ -39,11 +48,11 @@ Sign up, log in, click **Check session**. Chromium 145+ lands on `tier: "dbsc"`
39
48
  npm install dbsc-toolkit
40
49
  ```
41
50
 
42
- Pick the framework adapter and storage you actually use (each is an optional peer dependency):
51
+ Optional peer deps — install only the framework + storage you actually use:
43
52
 
44
53
  ```sh
45
- npm install express ioredis # Express + Redis
46
- npm install express pg # Express + Postgres
54
+ npm install express ioredis # Express + Redis
55
+ npm install fastify @fastify/cookie pg # Fastify + Postgres
47
56
  ```
48
57
 
49
58
  ## Quick start
@@ -91,6 +100,60 @@ Without the script tag those browsers stay on `tier: "none"`. Native Chromium 14
91
100
 
92
101
  Full walk-through: [docs/getting-started.md](./docs/getting-started.md).
93
102
 
103
+ ## Live demo
104
+
105
+ <https://dbsc-toolkit.onrender.com/>
106
+
107
+ Sign up, log in, click **Check session**. Chromium 146+ lands on `tier: "dbsc"` within a second; Firefox/Safari land on `tier: "bound"` within ~3 seconds. The demo uses a 60-second bound-cookie TTL so refresh fires fast — open DevTools Network and watch. Source: [examples/express/](./examples/express/).
108
+
109
+ ## Comparison
110
+
111
+ | | Plain cookies | JWT (bearer) | Native DBSC (Chrome 146+) | **dbsc-toolkit** |
112
+ |----------------------------|:-------------:|:------------:|:-------------------------:|:----------------:|
113
+ | Stops cookie / token replay from another device | ❌ | ❌ | ✅ | ✅ |
114
+ | Works on Chrome / Edge / Brave | ✅ | ✅ | ✅ (Windows + TPM) | ✅ |
115
+ | Works on Firefox | ✅ | ✅ | ❌ | ✅ (polyfill) |
116
+ | Works on Safari | ✅ | ✅ | ❌ | ✅ (polyfill) |
117
+ | Works on mobile / no-TPM | ✅ | ✅ | ❌ | ✅ (polyfill) |
118
+ | Per-request body-hash proof against MITM | ❌ | ❌ | ❌ (TPM key isn't reachable from JS) | ✅ |
119
+ | Captured-proof replay defense | n/a | ❌ | n/a | ✅ (v2.8 replay cache) |
120
+ | Multi-subdomain binding | ✅ (loose) | ✅ (loose) | ❌ (`__Host-` only) | ✅ (v2.9 `cookieScope: "site"`) |
121
+ | Server runtime | any | any | n/a (browser-side) | Node.js ≥ 20 |
122
+
123
+ The native-DBSC column refers to a server that uses the spec without a polyfill — what every other DBSC implementation currently offers. The polyfill key lives in IndexedDB (`extractable: false`) rather than a TPM, so it's a notch weaker against malware reading the browser profile, but defeats every remote-theft scenario.
124
+
125
+ ## "Why not just use JWT?"
126
+
127
+ JWTs are still bearer tokens. Whoever has the bytes can replay them. Steal a JWT from a log line, an XSS, a leaked proxy header, a misconfigured intermediary — paste it into another machine and the server treats it as the legitimate user, exactly like a stolen cookie.
128
+
129
+ DBSC pins the session to a cryptographic key that lives on the user's device (TPM, Secure Enclave, Android Keystore, or — under the polyfill — a non-extractable IndexedDB key). The token alone is no longer sufficient: the browser has to prove possession of the key on every refresh, and on every guarded request via `requireProof()`. The attacker's device has no key, so the replay fails and the session demotes within one cycle.
130
+
131
+ DBSC complements your existing auth (passwords, MFA, JWT/session cookies) — it does not replace them. It closes the *replay-after-issue* gap that bearer tokens cannot.
132
+
133
+ ## How it works (the 30-second version)
134
+
135
+ ```
136
+ Login → Key Registration → Cookie Issued → Challenge → Signature Verification → Session Refresh
137
+ ```
138
+
139
+ On login the server responds with a `Secure-Session-Registration` header. The browser generates an ECDSA keypair in the TPM (Chrome) or IndexedDB (Firefox/Safari/polyfill), POSTs the public key, and gets back a short-lived session cookie. Every ~10 minutes the browser re-signs a fresh server challenge to renew the cookie. A copy of the cookie pasted into another device has no key — the next refresh fails and `requireProof()` 403s every guarded request immediately.
140
+
141
+ Full wire-format walk-through: [HOW-IT-WORKS.md](./HOW-IT-WORKS.md).
142
+
143
+ ## Who is this for?
144
+
145
+ **Use `dbsc-toolkit` if:**
146
+ - You run a Node.js backend.
147
+ - Your users authenticate with session cookies (or JWT bearer tokens).
148
+ - Cookie / token theft is in your threat model — XSS, infostealer malware, leaked logs, compromised proxies.
149
+ - You want one library that covers Chrome **and** Firefox / Safari today, not "eventually."
150
+
151
+ **Not the right fit if:**
152
+ - You don't issue any persistent client credential (every request re-authenticates from scratch).
153
+ - You can't deploy HTTPS — DBSC cookies require `Secure`, and the spec rejects insecure origins.
154
+ - Your backend is Python / Go / Rust / Java / .NET — no port of this library exists yet; you'd implement against the [W3C spec](https://www.w3.org/TR/dbsc/) directly.
155
+ - You need DBSC on iOS / mobile Chrome / ChromeOS *with native key storage* — those platforms don't ship native DBSC. (The polyfill still works there; the key just lives in IndexedDB instead of secure hardware.)
156
+
94
157
  ## Adding to an existing app
95
158
 
96
159
  You don't rewrite login, you don't migrate the session store. DBSC sits alongside your existing session cookie and binds to the same session id. The whole integration for an Express app:
@@ -150,6 +213,16 @@ For apps with a stricter threat model (active MITM, log-spillage exposure), v2.8
150
213
 
151
214
  The full threat boundary, the per-framework wiring (Fastify / Hono / Next.js), and the migration timeline for an existing app are in [docs/integrating-existing-auth.md](./docs/integrating-existing-auth.md) and [docs/per-request-signing.md](./docs/per-request-signing.md).
152
215
 
216
+ ## Production checklist
217
+
218
+ - [ ] HTTPS enabled — DBSC requires `Secure` cookies; plain HTTP locks every user to `tier: "none"`
219
+ - [ ] Redis or PostgreSQL storage — `MemoryStorage` is lost on restart; bound browsers loop registration
220
+ - [ ] `requireProof()` on every authenticated route — read-only public routes need no guard
221
+ - [ ] `wrapFetch({ signBody: true })` on the client side for those routes (already the default in v2.8+)
222
+ - [ ] Replay cache enabled — `replayCache: new RedisReplayCache(redis)` in `createDbsc({...})`
223
+ - [ ] `trust proxy` already set — `install()` sets it, but verify if you have your own app config overriding it
224
+ - [ ] Polyfill script loaded — the `<script type="module">` tag; without it Firefox/Safari stay on `tier: "none"`
225
+
153
226
  ## Subpath imports
154
227
 
155
228
  | Import | What it is |
@@ -61,7 +61,14 @@ async function readBodyBytes(body) {
61
61
  return new TextEncoder().encode(String(body));
62
62
  }
63
63
  async function sha256B64Url(bytes) {
64
- const digest = await crypto.subtle.digest("SHA-256", bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength));
64
+ // Pass the Uint8Array directly. Earlier code sliced .buffer to escape any
65
+ // surrounding pool buffer; Node 22's stricter SubtleCrypto rejects that
66
+ // shape because the slice returns a generic ArrayBufferLike. A fresh
67
+ // Uint8Array copy gives the runtime a clean BufferSource without aliasing
68
+ // the input.
69
+ const copy = new Uint8Array(bytes.byteLength);
70
+ copy.set(bytes);
71
+ const digest = await crypto.subtle.digest("SHA-256", copy);
65
72
  return base64url(new Uint8Array(digest));
66
73
  }
67
74
  function base64url(b) {
@@ -1 +1 @@
1
- {"version":3,"file":"wrapFetch.js","sourceRoot":"","sources":["../../src/client/wrapFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgB7C,MAAM,UAAU,SAAS,CAAC,OAAyB,EAAE;IACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,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AI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,KAAiB;IAC3C,0EAA0E;IAC1E,wEAAwE;IACxE,qEAAqE;IACrE,0EAA0E;IAC1E,aAAa;IACb,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,SAAS,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,SAAS,CAAC,CAAa;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC3E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbsc-toolkit",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "Server-side Device Bound Session Credentials (DBSC) for Node.js plus a Web Crypto polyfill for Firefox, Safari, and older Chromium. Cookie-theft protection on every modern browser.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",