@le-space/orbitdb-identity-provider-webauthn-did 0.3.1 → 0.4.1
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/CHANGELOG.md +237 -0
- package/CODE_OF_CONDUCT.md +52 -0
- package/README.md +8 -3
- package/SECURITY.md +88 -0
- package/docs/API.md +412 -0
- package/package.json +50 -17
- package/src/constants.js +37 -0
- package/src/errors.js +83 -0
- package/src/index.js +39 -3
- package/src/keystore/derived-signing-key.js +198 -0
- package/src/keystore/encryption.js +70 -24
- package/src/keystore/provider.js +108 -28
- package/src/standalone/webauthn/credential.js +8 -3
- package/src/standalone/webauthn/hardware-service.js +10 -3
- package/src/varsig/assertion.js +15 -8
- package/src/varsig/credential.js +3 -1
- package/src/varsig/identity.js +15 -3
- package/src/varsig/storage.js +4 -3
- package/src/webauthn/identity-proof-store.js +130 -0
- package/src/webauthn/large-blob-metadata.js +4 -1
- package/src/webauthn/provider.js +273 -80
- package/types/index.d.ts +446 -0
- package/types/keystore.d.ts +165 -0
- package/types/standalone.d.ts +212 -0
- package/types/verification.d.ts +41 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Changes
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.4.1
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Derive the OrbitDB signing key from the passkey PRF output instead of letting
|
|
10
|
+
the keystore generate a random one. `Identities.createIdentity` takes
|
|
11
|
+
`keystore.getKey(id) || keystore.createKey(id)`, and `createKey` is random, so
|
|
12
|
+
the same passkey previously produced a different `publicKey` and
|
|
13
|
+
`signatures.id` — and therefore a different identity document — on every
|
|
14
|
+
device. Seeding the keystore during `getId()`, the last point before OrbitDB
|
|
15
|
+
asks for the key, makes the whole document reproducible: one block to keep
|
|
16
|
+
retrievable for a DID instead of one per device, and a device that loses its
|
|
17
|
+
keystore while keeping the passkey reconstructs the same identity rather than
|
|
18
|
+
minting another. Needs no change to `@orbitdb/core`.
|
|
19
|
+
- `createCredential()` now requests the PRF extension even when the keystore is
|
|
20
|
+
not encrypted, and stores the input. Without a stored input the output would
|
|
21
|
+
differ per call, so a credential registered without one can never get a
|
|
22
|
+
reproducible identity. Requesting it is harmless where unsupported.
|
|
23
|
+
|
|
24
|
+
### Notes
|
|
25
|
+
|
|
26
|
+
- Falls back cleanly. No PRF support, no stored input, or a refused assertion
|
|
27
|
+
leaves the keystore to generate its own key — 0.4.0 behaviour, stable per
|
|
28
|
+
device but not across devices. Opt out with
|
|
29
|
+
`deriveSigningKeyFromPrf: false`.
|
|
30
|
+
- An existing keystore key is never replaced. Swapping it under a device that
|
|
31
|
+
already has history would mint a second document for the DID, which is what
|
|
32
|
+
this avoids. Installs upgrading from 0.4.0 keep their key; fresh installs get
|
|
33
|
+
a reproducible identity.
|
|
34
|
+
- Costs one extra assertion the first time an identity is created on a device.
|
|
35
|
+
The key is persisted, so later loads do not repeat it.
|
|
36
|
+
|
|
37
|
+
## 0.4.0
|
|
38
|
+
|
|
39
|
+
### Breaking
|
|
40
|
+
|
|
41
|
+
- WebAuthn credentials now yield the authenticator's actual public key, so the
|
|
42
|
+
derived `did:key` **changes** for anyone who registered against 0.3.x or
|
|
43
|
+
earlier. Existing OrbitDB identities keyed on the old DID will not match, and
|
|
44
|
+
databases gated on it become unwritable under the new DID. `extractPublicKey()`
|
|
45
|
+
never took its intended path: `cbor-web` returns byte strings as views into
|
|
46
|
+
the enclosing buffer, so reading `credentialIdLength` through `authData.buffer`
|
|
47
|
+
without honouring `byteOffset` read bytes from inside `rpIdHash` and yielded
|
|
48
|
+
43690 for every credential. The COSE slice was then empty, `cbor` threw
|
|
49
|
+
`Insufficient data`, and the `catch` silently returned a synthetic key derived
|
|
50
|
+
from `SHA-256(credentialId)`.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- Keep the identity document stable across reloads. `signIdentity()` reuses the
|
|
55
|
+
proof it already produced instead of running a fresh WebAuthn assertion, which
|
|
56
|
+
changed `signatures.publicKey` — and therefore the content address of the
|
|
57
|
+
identity document — on every page load. Peers then dropped entries:
|
|
58
|
+
`verifiedIdentitiesCache` in `@orbitdb/core` is keyed on the deterministic
|
|
59
|
+
`signatures.id`, so two documents from one keystore collide on a single cache
|
|
60
|
+
entry and `isEqual()` rejects whichever was not verified first. The symptom was
|
|
61
|
+
a database replicating some entries and silently never receiving the rest.
|
|
62
|
+
- Remove the `timestamp` field from the proof envelope and the 24-hour expiry
|
|
63
|
+
check that read it. Both were wrong for a value embedded in content-addressed,
|
|
64
|
+
permanent history: the timestamp changed the document hash on every call, and
|
|
65
|
+
the expiry would have invalidated the identity behind every entry ever signed
|
|
66
|
+
under it. Compatible in both directions — proofs that still carry a timestamp
|
|
67
|
+
verify fine, and 0.3.1 verifying a proof without one computes `NaN`, which
|
|
68
|
+
fails its `> maxAge` test.
|
|
69
|
+
- Prefer `response.getPublicKey()` (WebAuthn L2) over parsing the attestation
|
|
70
|
+
object, and correct the parser: honour `byteOffset`, validate the AT flag,
|
|
71
|
+
bounds-check `credentialIdLength`, and decode only the first CBOR item so
|
|
72
|
+
trailing extension data (the ED flag, set when PRF is requested) no longer
|
|
73
|
+
throws. The synthetic fallback is now marked `synthetic: true`.
|
|
74
|
+
- Fix an ambiguous locator in `ed25519-keystore-did`: `getByLabel` matches
|
|
75
|
+
substrings, and the demo's worker toggle is labelled
|
|
76
|
+
"Use worker-backed Ed25519 keystore".
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
|
|
80
|
+
- Two-peer OrbitDB replication tests: real libp2p over loopback TCP, Helia with
|
|
81
|
+
bitswap, gossipsub, two OrbitDB instances, driven by a software WebAuthn
|
|
82
|
+
authenticator with a real P-256 keypair, an incrementing signature counter and
|
|
83
|
+
randomised signatures. Covers identity-document stability across reloads,
|
|
84
|
+
replication of entries written before and after a reload, and that two devices
|
|
85
|
+
sharing a passkey keep distinct, independently valid identities.
|
|
86
|
+
- Attestation-parsing unit tests: credential ID lengths 16/20/32/64/128,
|
|
87
|
+
trailing extension data, missing AT flag, non-P-256 COSE keys and truncated
|
|
88
|
+
coordinates. 13 of the 14 fail against 0.3.1.
|
|
89
|
+
|
|
90
|
+
### Changed
|
|
91
|
+
|
|
92
|
+
- CI now runs all eleven test files. Five never ran: `webauthn-unit`,
|
|
93
|
+
`webauthn-verification`, `standalone-toolkit`, `ed25519-keystore-did` and
|
|
94
|
+
`simple-encryption-integration`. `webauthn-unit` imports through Vite's `/@fs`
|
|
95
|
+
endpoint, which only the dev server exposes, so its step runs against `dev`
|
|
96
|
+
rather than the `preview` build CI otherwise uses.
|
|
97
|
+
- Publishing moves into CI. A `v*` tag runs the full suite and then publishes
|
|
98
|
+
via npm Trusted Publishing (OIDC), with provenance. A manual run defaults to a
|
|
99
|
+
check mode that verifies tag/version agreement and packaging without
|
|
100
|
+
publishing.
|
|
101
|
+
- `test:ci`, which `preversion` and `prepublishOnly` run, now points at the
|
|
102
|
+
Node-context suites via `playwright.node.config.js` — 32 tests in about ten
|
|
103
|
+
seconds. It previously ran `webauthn-verification` alone: five tests that check
|
|
104
|
+
regexes against hardcoded DID literals and one fully mocked database object,
|
|
105
|
+
none of which creates a credential, touches the keystore or opens an OrbitDB.
|
|
106
|
+
- Restore the `security-audit`, `package-validation` and `notify` jobs. The
|
|
107
|
+
enforced audit gate is `--prod --audit-level=critical`; auditing the full tree
|
|
108
|
+
at `moderate` reports 86 advisories from the helia and libp2p dev tree, and
|
|
109
|
+
even `--prod` reports 5 through `iso-web > iso-kv > conf > ajv`, so both wider
|
|
110
|
+
audits run informational until that chain is bumped.
|
|
111
|
+
|
|
112
|
+
### Also shipping in this release
|
|
113
|
+
|
|
114
|
+
Entries that had accumulated under Unreleased since 0.3.1:
|
|
115
|
+
|
|
116
|
+
- Add `SECURITY.md` with vulnerability reporting and supported-version policy.
|
|
117
|
+
- Rename `changes.md` to `CHANGELOG.md` and include it in the published package.
|
|
118
|
+
- Add public TypeScript declarations for the root, standalone, verification,
|
|
119
|
+
and keystore package entrypoints.
|
|
120
|
+
- Add `docs/API.md` and expose `@le-space/orbitdb-identity-provider-webauthn-did/keystore`
|
|
121
|
+
as a typed package subpath.
|
|
122
|
+
- Remove the Vite node polyfill plugin from production dependencies, update
|
|
123
|
+
the varsig support stack to `iso-web@^3.1.2`, and verify
|
|
124
|
+
`npm audit --omit=dev` reports zero production advisories.
|
|
125
|
+
- Re-enable the CI lint step and verify `pnpm run lint` passes.
|
|
126
|
+
- Add shared public constants and catchable error classes for WebAuthn,
|
|
127
|
+
keystore, and varsig flows.
|
|
128
|
+
- Add root Prettier scripts, ignore rules, and a CI formatting check.
|
|
129
|
+
- Add `CODE_OF_CONDUCT.md` and include it in the published package.
|
|
130
|
+
|
|
131
|
+
## 0.3.1
|
|
132
|
+
|
|
133
|
+
- Bump package metadata to `0.3.1` and create the clean release tag after
|
|
134
|
+
the post-`0.3.0` CI fixes landed.
|
|
135
|
+
- Update example lockfiles so all demos install successfully with
|
|
136
|
+
`pnpm install --frozen-lockfile`.
|
|
137
|
+
- Fix Playwright web server startup by passing Vite `preview`/`dev` arguments
|
|
138
|
+
directly, avoiding CI timeouts waiting for the wrong port.
|
|
139
|
+
- Update GitHub Actions to current action majors:
|
|
140
|
+
`actions/checkout@v7`, `pnpm/action-setup@v6`, `actions/setup-node@v6`,
|
|
141
|
+
and `actions/upload-artifact@v7`.
|
|
142
|
+
- Verify the release commit with GitHub Actions:
|
|
143
|
+
root frozen install, all three example frozen installs, all three example
|
|
144
|
+
builds, WebAuthn focused tests, logging E2E, integration E2E, varsig E2E,
|
|
145
|
+
encrypted-keystore tests, and Ed25519 encrypted-keystore E2E.
|
|
146
|
+
- Verify the package tarball with `npm pack --dry-run`; the package reports
|
|
147
|
+
`@le-space/orbitdb-identity-provider-webauthn-did@0.3.1` with 27 published
|
|
148
|
+
files.
|
|
149
|
+
|
|
150
|
+
## 0.3.0
|
|
151
|
+
|
|
152
|
+
- Upgrade the OrbitDB stack to `@orbitdb/core@^4.0.0`.
|
|
153
|
+
- Upgrade Helia to `helia@^7.0.1` and add the current Helia service packages:
|
|
154
|
+
`@helia/libp2p`, `@helia/http`, and `@helia/bitswap`.
|
|
155
|
+
- Upgrade libp2p to `libp2p@^3.3.4` and the current scoped packages,
|
|
156
|
+
including `@libp2p/gossipsub@^16.0.3`, `@libp2p/identify@^4.1.8`,
|
|
157
|
+
`@libp2p/websockets@^10.1.15`, `@chainsafe/libp2p-noise@^17.0.0`,
|
|
158
|
+
and `@chainsafe/libp2p-yamux@^8.0.1`.
|
|
159
|
+
- Confirm the gossipsub stream-registry fix from
|
|
160
|
+
`libp2p/js-libp2p#3531` is included via `@libp2p/gossipsub@16.0.3`.
|
|
161
|
+
- Port all Svelte examples to the OrbitDB 4, Helia 7, and libp2p 3 stack:
|
|
162
|
+
`webauthn-todo-demo`, `ed25519-encrypted-keystore-demo`, and
|
|
163
|
+
`webauthn-varsig-demo`.
|
|
164
|
+
- Update example libp2p configuration for the v3 `connectionEncrypters`
|
|
165
|
+
option and current `withLibp2p`, `withHTTP`, and `withBitswap` Helia setup.
|
|
166
|
+
- Update OrbitDB identity and keystore integration for the current OrbitDB 4
|
|
167
|
+
public APIs, including keystore key generation/storage.
|
|
168
|
+
- Replace older dynamic codec/hash imports with static multiformats imports
|
|
169
|
+
where needed.
|
|
170
|
+
- Remove obsolete local OrbitDB patches.
|
|
171
|
+
- Clean up known Vite/polyfill build warnings in the examples.
|
|
172
|
+
- Fix varsig verification edge cases for replicated entries, mixed
|
|
173
|
+
worker/hardware verification, and Node relay default exports.
|
|
174
|
+
|
|
175
|
+
## 0.2.10
|
|
176
|
+
|
|
177
|
+
- Release metadata update after varsig verification and worker/hardware
|
|
178
|
+
compatibility fixes.
|
|
179
|
+
|
|
180
|
+
## 0.2.9
|
|
181
|
+
|
|
182
|
+
- Version metadata update after discoverable passkey recovery work.
|
|
183
|
+
|
|
184
|
+
## 0.2.8
|
|
185
|
+
|
|
186
|
+
- Add discoverable passkey recovery flows.
|
|
187
|
+
- Add worker-backed keystore demo coverage and fix the worker keystore demo
|
|
188
|
+
build.
|
|
189
|
+
- Export varsig verification, identity storage, and
|
|
190
|
+
`wrapWithVarsigVerification`.
|
|
191
|
+
- Stabilize Chromium E2E/unit coverage and align Ed25519 keystore tests.
|
|
192
|
+
- Sync docs, format the codebase, and restrict CI Playwright runs to Chromium.
|
|
193
|
+
|
|
194
|
+
## 0.2.6
|
|
195
|
+
|
|
196
|
+
- Release metadata update for the standalone compatibility series.
|
|
197
|
+
|
|
198
|
+
## 0.2.5
|
|
199
|
+
|
|
200
|
+
- Add standalone compatibility fallback release.
|
|
201
|
+
|
|
202
|
+
## 0.2.4
|
|
203
|
+
|
|
204
|
+
- Re-enable encrypted-keystore CI and stabilize demo checks.
|
|
205
|
+
- Sync pnpm lockfile with package dependencies.
|
|
206
|
+
- Run CI on pushes to all branches.
|
|
207
|
+
- Merge the standalone WebAuthn toolkit feature branch.
|
|
208
|
+
|
|
209
|
+
## 0.2.3
|
|
210
|
+
|
|
211
|
+
- Add reusable standalone WebAuthn worker and varsig toolkit exports.
|
|
212
|
+
- Restore ucanto signer metadata and add issuance regression coverage.
|
|
213
|
+
- Stabilize WebAuthn unit harness and mock credentials.
|
|
214
|
+
- Finalize standalone toolkit integration and README updates.
|
|
215
|
+
- Refresh pnpm lockfile.
|
|
216
|
+
|
|
217
|
+
## 0.2.2
|
|
218
|
+
|
|
219
|
+
- Ship patch-package in dependencies so postinstall works for consumers.
|
|
220
|
+
|
|
221
|
+
## 0.2.1
|
|
222
|
+
|
|
223
|
+
- Add WebAuthn varsig demo E2E coverage and test-mode stubs for CI.
|
|
224
|
+
- Update CI to focus on Chromium-only runs and disable failing encrypted keystore tests.
|
|
225
|
+
- Add @libp2p/crypto dependency and update lockfile.
|
|
226
|
+
- Publish varsig demo build to Storacha and link in README.
|
|
227
|
+
|
|
228
|
+
## 0.2.0
|
|
229
|
+
|
|
230
|
+
- Switch iso dependencies to the published `@le-space` fork and pin `@le-space/iso-did@2.1.2`.
|
|
231
|
+
- Restore unscoped `iso-web` from npm to satisfy `iso-did` runtime deps.
|
|
232
|
+
- Document forked iso packages used for WebAuthn varsig support.
|
|
233
|
+
- Clarify Varsig vs keystore-based DID paths and reference the example demos.
|
|
234
|
+
|
|
235
|
+
## 0.1.0 (preview)
|
|
236
|
+
|
|
237
|
+
- Initial preview release with WebAuthn DID and varsig provider.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We are committed to making this project a welcoming, respectful, and
|
|
6
|
+
harassment-free space for everyone who contributes, reports issues, reviews
|
|
7
|
+
code, writes documentation, or participates in project discussions.
|
|
8
|
+
|
|
9
|
+
## Expected Behavior
|
|
10
|
+
|
|
11
|
+
- Use welcoming and inclusive language.
|
|
12
|
+
- Be respectful of differing viewpoints and experience levels.
|
|
13
|
+
- Give and receive constructive feedback with care.
|
|
14
|
+
- Focus criticism on ideas, code, and project outcomes, not on people.
|
|
15
|
+
- Respect privacy, security boundaries, and responsible disclosure processes.
|
|
16
|
+
|
|
17
|
+
## Unacceptable Behavior
|
|
18
|
+
|
|
19
|
+
Unacceptable behavior includes harassment, discriminatory language, personal
|
|
20
|
+
attacks, intimidation, unwanted attention, publishing private information
|
|
21
|
+
without consent, or any behavior that would reasonably make participation feel
|
|
22
|
+
unsafe or hostile.
|
|
23
|
+
|
|
24
|
+
Because this project touches identity, cryptography, WebAuthn, and local-first
|
|
25
|
+
security flows, do not pressure others to disclose private credentials, seeds,
|
|
26
|
+
keys, vulnerability details, or personal identity information in public
|
|
27
|
+
channels.
|
|
28
|
+
|
|
29
|
+
## Reporting
|
|
30
|
+
|
|
31
|
+
If you experience or witness unacceptable behavior, please contact the project
|
|
32
|
+
maintainers through GitHub. For security-sensitive issues, follow the reporting
|
|
33
|
+
process in `SECURITY.md` instead of posting details publicly.
|
|
34
|
+
|
|
35
|
+
Reports should include enough context for maintainers to understand what
|
|
36
|
+
happened, while avoiding unnecessary disclosure of private information.
|
|
37
|
+
Maintainers will review reports in good faith and handle them as confidentially
|
|
38
|
+
as practical.
|
|
39
|
+
|
|
40
|
+
## Enforcement
|
|
41
|
+
|
|
42
|
+
Maintainers may take action they consider appropriate, including clarification,
|
|
43
|
+
moderation, temporary limits on participation, removal from project spaces, or
|
|
44
|
+
permanent bans for repeated or severe violations.
|
|
45
|
+
|
|
46
|
+
Anyone asked to stop unacceptable behavior is expected to comply immediately.
|
|
47
|
+
|
|
48
|
+
## Scope
|
|
49
|
+
|
|
50
|
+
This code of conduct applies in project spaces, including GitHub issues, pull
|
|
51
|
+
requests, discussions, documentation, examples, and any other official project
|
|
52
|
+
collaboration channels.
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ This package provides:
|
|
|
8
8
|
|
|
9
9
|
- Two WebAuthn-based OrbitDB identity providers.
|
|
10
10
|
- A standalone WebAuthn toolkit export (`@le-space/orbitdb-identity-provider-webauthn-did/standalone`) for reuse outside OrbitDB identity wiring.
|
|
11
|
+
- A keystore helper export (`@le-space/orbitdb-identity-provider-webauthn-did/keystore`) for encrypted keystore utilities and provider wiring.
|
|
11
12
|
- **WebAuthn-Varsig**: No insecure OrbitDB keystore at all. Each entry is signed by WebAuthn (varsig envelope), so keys never leave the authenticator, one Passkey (WebAuthn) prompt per write.
|
|
12
13
|
- **Keystore-based DID**: Generates an Ed25519/secp256k1 keystore keypair for OrbitDB signing in browser memory. When `encryptKeystore` is enabled, the private key is encrypted with AES-GCM and only rehydrated in memory after a WebAuthn unlock (PRF, largeBlob, or hmac-secret).
|
|
13
14
|
|
|
@@ -262,9 +263,10 @@ sequenceDiagram
|
|
|
262
263
|
|
|
263
264
|
Svelte demos:
|
|
264
265
|
|
|
265
|
-
-
|
|
266
|
-
- `examples/ed25519-encrypted-keystore-demo/` - Ed25519 keystore DID; keystore encrypted at rest with WebAuthn (PRF when available, otherwise largeBlob/hmac-secret).
|
|
267
|
-
- `examples/webauthn-varsig-demo/` - Varsig provider with passkey signing for each entry. Includes discoverable credential diagnostics, `Use Existing Passkey`, `largeBlob` varsig metadata recovery, and local fallback recovery. Live demo: https://
|
|
266
|
+
- Live demo directory: https://le-space.github.io/orbitdb-identity-provider-webauthn-did/
|
|
267
|
+
- `examples/ed25519-encrypted-keystore-demo/` - Ed25519 keystore DID; keystore encrypted at rest with WebAuthn (PRF when available, otherwise largeBlob/hmac-secret). Live demo: https://le-space.github.io/orbitdb-identity-provider-webauthn-did/ed25519-encrypted-keystore-demo/
|
|
268
|
+
- `examples/webauthn-varsig-demo/` - Varsig provider with passkey signing for each entry. Includes discoverable credential diagnostics, `Use Existing Passkey`, `largeBlob` varsig metadata recovery, and local fallback recovery. Live demo: https://le-space.github.io/orbitdb-identity-provider-webauthn-did/webauthn-varsig-demo/
|
|
269
|
+
- `examples/webauthn-todo-demo/` - WebAuthn DID (no keystore signing; identity-only). Includes discoverable credential diagnostics, `Use Existing Passkey`, `largeBlob` identity metadata recovery, and local fallback recovery. Live demo: https://le-space.github.io/orbitdb-identity-provider-webauthn-did/webauthn-todo-demo/
|
|
268
270
|
|
|
269
271
|
Scripted examples:
|
|
270
272
|
|
|
@@ -278,12 +280,15 @@ Mermaid sequences for scripts:
|
|
|
278
280
|
|
|
279
281
|
## Documentation
|
|
280
282
|
|
|
283
|
+
- `docs/API.md`
|
|
281
284
|
- `docs/ED25519-KEYSTORE-DID.md`
|
|
282
285
|
- `docs/WEBAUTHN-ENCRYPTED-KEYSTORE-INTEGRATION.md`
|
|
283
286
|
- `docs/WEBAUTHN-DID-AND-ORBITDB-IDENTITY.md`
|
|
284
287
|
- `docs/STANDALONE-API-PLAN.md`
|
|
285
288
|
- `docs/EXAMPLE-SEQUENCES.md`
|
|
286
289
|
- `docs/E2E-TEST-SUMMARY.md`
|
|
290
|
+
- `SECURITY.md`
|
|
291
|
+
- `CODE_OF_CONDUCT.md`
|
|
287
292
|
|
|
288
293
|
## Identity Recovery Summary
|
|
289
294
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Security fixes are provided for the current `0.3.x` release line.
|
|
6
|
+
|
|
7
|
+
| Version | Supported |
|
|
8
|
+
| ------- | --------- |
|
|
9
|
+
| 0.3.x | Yes |
|
|
10
|
+
| < 0.3 | No |
|
|
11
|
+
|
|
12
|
+
## Reporting a Vulnerability
|
|
13
|
+
|
|
14
|
+
Please do not report security vulnerabilities through public GitHub issues.
|
|
15
|
+
|
|
16
|
+
Report suspected vulnerabilities by email:
|
|
17
|
+
|
|
18
|
+
security@le-space.de
|
|
19
|
+
|
|
20
|
+
Please include as much detail as you can:
|
|
21
|
+
|
|
22
|
+
- affected package version, commit, or tag
|
|
23
|
+
- affected browser, runtime, or operating system
|
|
24
|
+
- steps to reproduce
|
|
25
|
+
- expected and actual behavior
|
|
26
|
+
- proof of concept, logs, screenshots, or traces if available
|
|
27
|
+
- your assessment of impact
|
|
28
|
+
|
|
29
|
+
We aim to acknowledge reports within 48 hours and coordinate fixes before
|
|
30
|
+
public disclosure.
|
|
31
|
+
|
|
32
|
+
## Security Model
|
|
33
|
+
|
|
34
|
+
This package provides WebAuthn-based identity providers and helper APIs for
|
|
35
|
+
OrbitDB. It handles sensitive identity material and should be reviewed in the
|
|
36
|
+
context of the application that embeds it.
|
|
37
|
+
|
|
38
|
+
### Varsig Provider
|
|
39
|
+
|
|
40
|
+
The varsig provider is the preferred security model when available. Entry
|
|
41
|
+
signing is performed through WebAuthn assertions, so the private key remains
|
|
42
|
+
inside the authenticator and is not exported to application memory.
|
|
43
|
+
|
|
44
|
+
### Keystore Provider
|
|
45
|
+
|
|
46
|
+
The keystore provider can generate browser-side Ed25519 or secp256k1 keys for
|
|
47
|
+
OrbitDB signing. When encrypted keystore mode is enabled, key material is
|
|
48
|
+
encrypted at rest with AES-GCM and unlocked through WebAuthn-supported secret
|
|
49
|
+
recovery mechanisms such as PRF, largeBlob, or hmac-secret.
|
|
50
|
+
|
|
51
|
+
During an unlocked session, private key material may exist in browser memory.
|
|
52
|
+
Applications with stricter requirements should prefer the varsig provider or
|
|
53
|
+
keep keystore sessions short.
|
|
54
|
+
|
|
55
|
+
### Identity Metadata Recovery
|
|
56
|
+
|
|
57
|
+
Discoverable passkeys can identify a credential during authentication, but
|
|
58
|
+
WebAuthn assertions do not reliably return the public key after registration.
|
|
59
|
+
This package therefore needs identity metadata persistence for recovery.
|
|
60
|
+
|
|
61
|
+
The example applications use:
|
|
62
|
+
|
|
63
|
+
- WebAuthn largeBlob metadata as the preferred recovery path
|
|
64
|
+
- browser localStorage as a fallback when largeBlob is unavailable or empty
|
|
65
|
+
|
|
66
|
+
Applications should treat localStorage metadata as recoverability metadata, not
|
|
67
|
+
as a replacement for authenticator-backed key protection.
|
|
68
|
+
|
|
69
|
+
## Operational Guidance
|
|
70
|
+
|
|
71
|
+
- Serve production applications over HTTPS.
|
|
72
|
+
- Configure WebAuthn relying party IDs and origins deliberately.
|
|
73
|
+
- Prefer the varsig provider for hardware-backed signing on every write.
|
|
74
|
+
- Enable encrypted keystore mode if using the keystore provider in production.
|
|
75
|
+
- Keep dependencies updated and review `npm audit --omit=dev` output before
|
|
76
|
+
production deployments.
|
|
77
|
+
- Do not log private keys, PRF seeds, decrypted keystore archives, or raw secret
|
|
78
|
+
key material.
|
|
79
|
+
- Review browser storage behavior for your deployment, especially if using
|
|
80
|
+
localStorage fallback recovery.
|
|
81
|
+
|
|
82
|
+
## Disclosure Process
|
|
83
|
+
|
|
84
|
+
1. A vulnerability report is received privately.
|
|
85
|
+
2. We acknowledge the report and investigate impact.
|
|
86
|
+
3. We prepare and test a fix.
|
|
87
|
+
4. We publish a patched release.
|
|
88
|
+
5. We coordinate public disclosure with the reporter where appropriate.
|