blindfill 0.0.0 → 0.1.0
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/LICENSE +21 -0
- package/README.ja.md +90 -0
- package/README.ko.md +90 -0
- package/README.md +114 -1
- package/README.zh-CN.md +90 -0
- package/README.zh-TW.md +90 -0
- package/SECURITY.md +223 -0
- package/dist/android/blindfill-companion.apk +0 -0
- package/dist/chunk-KA4SHI33.js +402 -0
- package/dist/chunk-V4KGRR36.js +5671 -0
- package/dist/cli.js +1112 -0
- package/dist/index.d.ts +1068 -0
- package/dist/index.js +82 -0
- package/dist/mcp.d.ts +7 -0
- package/dist/mcp.js +343 -0
- package/docs/ARCHITECTURE.md +373 -0
- package/docs/RELEASING.md +51 -0
- package/docs/TESTED.md +87 -0
- package/docs/backends/bitwarden.md +23 -0
- package/docs/backends/other.md +16 -0
- package/docs/browsers.md +215 -0
- package/docs/design/android-app-registration-webview.md +92 -0
- package/docs/design/line-gateway-login.md +229 -0
- package/docs/design/passkey-feasibility.md +424 -0
- package/package.json +75 -6
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
# Passkey registration and sign-in in every browser: feasibility
|
|
2
|
+
|
|
3
|
+
Status: research (2026-11-27). Since built: Phase 1 (counter write-back, BE/BS), Phase 2 (Chromium
|
|
4
|
+
registration, add only), Phase 3 (Firefox/Camoufox over Marionette) and Phase 4 (Android registration);
|
|
5
|
+
see ARCHITECTURE §3.8 and §3.2. Claims marked **[observed]** come from the
|
|
6
|
+
local experiments in §8; **[source]** from the cited specification or source code; **[inference]** were
|
|
7
|
+
not verified.
|
|
8
|
+
|
|
9
|
+
## 1. Verdict
|
|
10
|
+
|
|
11
|
+
**Partially feasible.** Registration and sign-in, with the private key never reaching the agent, can be
|
|
12
|
+
built for:
|
|
13
|
+
|
|
14
|
+
| Surface | Sign-in | Registration | How | Verdict |
|
|
15
|
+
| -------------------------------- | --------------------------------- | ------------------------------- | -------------------------------------------------- | ---------------------------------------- |
|
|
16
|
+
| Chromium (launch, CDP attach) | built, needs counter fix | feasible | CDP `WebAuthn` virtual authenticator | **feasible** |
|
|
17
|
+
| Firefox / Camoufox | feasible | feasible | Marionette WebAuthn commands next to Juggler | **feasible with conditions** (see below) |
|
|
18
|
+
| Android apps (companion) | built, needs counter and flag fix | feasible | Credential Manager provider, host-side key | **feasible** |
|
|
19
|
+
| WebKit | only through a page-script shim | only through a page-script shim | no virtual authenticator reachable from Playwright | **not recommended** |
|
|
20
|
+
| Any browser via page-script shim | possible | possible | override `navigator.credentials` in the main world | **not recommended** (§5.3) |
|
|
21
|
+
|
|
22
|
+
Why not "every browser": WebKit has no automation hook for WebAuthn that Playwright exposes, and the only
|
|
23
|
+
universal route (a page-script shim, including Playwright 1.61's `context.credentials`) moves origin and
|
|
24
|
+
rpId enforcement out of the browser and is detectable by pages; Playwright's own shim is a cross-origin
|
|
25
|
+
signing oracle **[observed]**.
|
|
26
|
+
|
|
27
|
+
Conditions for Camoufox: the browser must be **started** with `-marionette` and the global prefs
|
|
28
|
+
`security.webauth.webauthn_enable_softtoken=true` / `security.webauth.webauthn_enable_usbtoken=false`.
|
|
29
|
+
That means restarting Ollie's running Camoufox, disabling real USB security keys in it while the prefs are
|
|
30
|
+
set, and running an unauthenticated Marionette listener on loopback. It worked on Camoufox
|
|
31
|
+
158.0.1-beta.41 (macOS arm64) side by side with Juggler, and `navigator.webdriver` stayed `false`
|
|
32
|
+
**[observed]**; the Linux build Ollie runs is unverified.
|
|
33
|
+
|
|
34
|
+
Two bugs in today's sign-in surfaced on the way (fix before registration, §4):
|
|
35
|
+
|
|
36
|
+
- **Counter**: Chromium reports `storedCounter + 1` and blindfill never writes it back, so every Chromium
|
|
37
|
+
sign-in after the first reports the same counter. RPs that reject a non-increasing counter (for example
|
|
38
|
+
SimpleWebAuthn's default) will refuse the second sign-in **[source + observed]**.
|
|
39
|
+
- **Backup flags**: Bitwarden clients sign with BE=1, BS=1; blindfill's Android path and both virtual
|
|
40
|
+
authenticators sign with BE=0. WebAuthn L3 tells RPs that track backup eligibility to reject a change
|
|
41
|
+
**[source]**.
|
|
42
|
+
|
|
43
|
+
Effort: about 12–16 agent-days in five phases (§7). First step: the three spikes in Phase 0, all on fake
|
|
44
|
+
or test-only relying parties.
|
|
45
|
+
|
|
46
|
+
## 2. Current state (what exists)
|
|
47
|
+
|
|
48
|
+
- Web sign-in: `Engine.passkey` → `WebActuator.passkeyAssert` (`src/engine.ts`, `src/actuators/web/web.ts`).
|
|
49
|
+
Checks item binding, then `passkey.rpId` covers the page host, then one-shot per session and origin, then
|
|
50
|
+
loads `login.fido2Credentials[0]` into a per-page Chromium virtual authenticator, clicks, waits up to
|
|
51
|
+
15 s for `WebAuthn.credentialAsserted`, removes the authenticator. Reports `counter_written_back: false`.
|
|
52
|
+
- Android sign-in: the companion builds `clientDataJSON` (`android:apk-key-hash:` origin) and sends its
|
|
53
|
+
hash; the host signs `rpIdHash || 0x05 || counter 0 || hash` (`Engine.androidOffer`).
|
|
54
|
+
`PasskeyProvider.onBeginCreateCredentialRequest` returns no entries.
|
|
55
|
+
- Vault shape: `bw` returns `login.fido2Credentials[]`; blindfill uses element 0 only (`bwmap.ts`,
|
|
56
|
+
`rawitem.ts`). Credential ids are a GUID or `b64.<base64url>` (`credentialIdBase64`).
|
|
57
|
+
- Writes: `bw create item` / `bw edit item` with the JSON body on stdin (`src/backends/bw.ts`).
|
|
58
|
+
Origins, `blindfill.*` fields and secret values need `human: true` (a TTY), except `item generate`, which
|
|
59
|
+
creates a new item with a generated password bound to caller-named origins (SECURITY.md item 10).
|
|
60
|
+
|
|
61
|
+
## 3. Registration
|
|
62
|
+
|
|
63
|
+
### 3.1 Vault format (Bitwarden-compatible)
|
|
64
|
+
|
|
65
|
+
What Bitwarden's own authenticator writes on `makeCredential` (`createKeyView` in
|
|
66
|
+
[`fido2-authenticator.service.ts`][bw-auth]) **[source]**:
|
|
67
|
+
|
|
68
|
+
| field | value written by Bitwarden | blindfill registration should write |
|
|
69
|
+
| ----------------------------- | ---------------------------------- | ------------------------------------------------------------------------------ |
|
|
70
|
+
| `credentialId` | new UUID (16 random bytes as GUID) | GUID if the id is 16 bytes, else `b64.<base64url>` (Chromium/Firefox use 32 B) |
|
|
71
|
+
| `keyType` | `public-key` | same |
|
|
72
|
+
| `keyAlgorithm` | `ECDSA` | same; refuse anything but ES256 (`alg -7`) |
|
|
73
|
+
| `keyCurve` | `P-256` | same |
|
|
74
|
+
| `keyValue` | PKCS#8 DER, base64url | same |
|
|
75
|
+
| `rpId`, `rpName` | from the request | same |
|
|
76
|
+
| `userHandle` | `user.id`, base64url | same |
|
|
77
|
+
| `userName`, `userDisplayName` | from the request | same (readable metadata) |
|
|
78
|
+
| `counter` | `0` | the authenticator's value after creation (§4.1) |
|
|
79
|
+
| `discoverable` | `requireResidentKey` | `true` (virtual authenticators create resident keys) |
|
|
80
|
+
| `creationDate` | now | now |
|
|
81
|
+
|
|
82
|
+
Bitwarden clients parse `b64.` ids (`parseCredentialId` in [`credential-id-utils.ts`][bw-credid]), which is
|
|
83
|
+
how imported passkeys are stored, so 32-byte ids from browser authenticators stay usable by the Bitwarden
|
|
84
|
+
extension and apps **[source]**; a real-client round trip is still unverified (Phase 0). Bitwarden clients
|
|
85
|
+
only ever use `fido2Credentials[0]` (`findCredentialsByRp`, `getAssertion`) **[source]**: one passkey per
|
|
86
|
+
item. blindfill must keep that rule: registration refuses an item that already has a passkey.
|
|
87
|
+
|
|
88
|
+
Other backends (`op`, `rbw`, KeePassXC, …) have their own passkey formats or none; registration is
|
|
89
|
+
`bw`-only until one of them is mapped and verified.
|
|
90
|
+
|
|
91
|
+
### 3.2 Where the key is generated and who sees it
|
|
92
|
+
|
|
93
|
+
| Route | Key generated in | Path of the private key |
|
|
94
|
+
| ----------------------------- | ----------------------------------------- | --------------------------------------------------------------------- |
|
|
95
|
+
| Chromium CDP | Chromium (virtual authenticator) | Chromium → `WebAuthn.getCredentials` → blindfill → `bw` stdin → Vault |
|
|
96
|
+
| Firefox / Camoufox Marionette | Firefox (`authrs_bridge` test token) | Firefox → `WebAuthn:GetCredentials` → blindfill → `bw` stdin → Vault |
|
|
97
|
+
| Android | blindfill host (`crypto.generateKeyPair`) | host → `bw` stdin → Vault; the phone receives only public data |
|
|
98
|
+
|
|
99
|
+
In every route the key passes through the blindfill process, as it already does for sign-in. It is never
|
|
100
|
+
returned, logged or printed: it goes into a `SecretHandle`, is registered with the scrubber, and the
|
|
101
|
+
result object carries only `credential_id`, `rp_id`, `counter`, `item`. The agent sees what it sees today
|
|
102
|
+
for a generated password (§3.3). Both browser `getCredentials` calls return private keys
|
|
103
|
+
**[observed]**, so the read must stay inside the actuator, like `addCredential` today.
|
|
104
|
+
|
|
105
|
+
Ordering risk: with browser-generated keys the relying party may have accepted the credential before
|
|
106
|
+
blindfill has written it to the vault. If the vault write then fails, the account holds a passkey nobody
|
|
107
|
+
has. Mitigation: create or pick the vault item **before** the ceremony (reuse `item generate`'s item, or
|
|
108
|
+
an existing bound item without a passkey), so the only write after the ceremony is one `bw edit item`;
|
|
109
|
+
on failure report `vault_write_failed` with the rp and credential id so a person can delete the passkey at
|
|
110
|
+
the RP. Android does better: the host generates the key and can write the vault before it returns the
|
|
111
|
+
attestation to the phone.
|
|
112
|
+
|
|
113
|
+
Attestation: `none` everywhere. Chromium and Firefox produce their own `none` attestation and AAGUID; RPs
|
|
114
|
+
that name passkeys by AAGUID will show "unknown" rather than "Bitwarden" **[inference]**. The Android path
|
|
115
|
+
should use Bitwarden's AAGUID only if Mics wants these passkeys to look Bitwarden-made; default: all-zero
|
|
116
|
+
AAGUID, like Playwright's.
|
|
117
|
+
|
|
118
|
+
### 3.3 The "person at a terminal" rule
|
|
119
|
+
|
|
120
|
+
Today a TTY is required to change secret values, origins and `blindfill.*` fields; `item generate` is the
|
|
121
|
+
deliberate exception (a new secret nobody knew, bound to the origins the caller names). Passkey
|
|
122
|
+
registration is the same kind of act: a new secret, generated by machine, bound to an origin. Proposed
|
|
123
|
+
rule, no TTY needed when **all** hold:
|
|
124
|
+
|
|
125
|
+
1. the item binds the page (the `blindfill.registration=allow` opt-in was dropped on 2026-11-28);
|
|
126
|
+
2. the item has no passkey yet (adding only; replacing or deleting a passkey needs a TTY);
|
|
127
|
+
3. the item binds the page (`checkWebBinding`) and the requested rpId equals the page host or a parent of
|
|
128
|
+
it, the same checks as sign-in; for Android the item binds the calling package and signer;
|
|
129
|
+
4. one registration per session, item and origin;
|
|
130
|
+
5. the vault write touches only `login.fido2Credentials` (and fills an empty username).
|
|
131
|
+
|
|
132
|
+
This is a decision for Mics (§9): registering a passkey adds a sign-in method to a real account, which is
|
|
133
|
+
an account-security change on the RP side even though the key never leaves blindfill.
|
|
134
|
+
|
|
135
|
+
## 4. Counter, flags, selection, binding
|
|
136
|
+
|
|
137
|
+
### 4.1 Counter
|
|
138
|
+
|
|
139
|
+
WebAuthn L3 §7.2: if either the stored or the reported counter is non-zero and the reported one is not
|
|
140
|
+
greater, the RP gets a cloned-authenticator signal and applies its own policy [webauthn-verify]
|
|
141
|
+
**[source]**. SimpleWebAuthn throws in that case [simplewebauthn] **[source]**.
|
|
142
|
+
|
|
143
|
+
What each signer reports for a stored counter `n` **[observed]**:
|
|
144
|
+
|
|
145
|
+
| Signer | Reports | Stored after |
|
|
146
|
+
| -------------------------------- | -------------------------------------------- | ----------------------------- |
|
|
147
|
+
| Bitwarden clients | `0` if `n == 0`, else `n + 1` (written back) | unchanged if 0 [bw-auth] |
|
|
148
|
+
| Chromium virtual authenticator | `n + 1` | `n + 1` (in the browser only) |
|
|
149
|
+
| Firefox virtual authenticator | `n`, then `n + 1` | `n + 1` (in the browser only) |
|
|
150
|
+
| blindfill Android host | always `0` | — |
|
|
151
|
+
| Playwright `context.credentials` | `n + 1` | `n + 1` |
|
|
152
|
+
|
|
153
|
+
Today Chromium therefore sends `1` on every sign-in of a Bitwarden-made passkey, and the second sign-in
|
|
154
|
+
fails at strict RPs. One rule for every path:
|
|
155
|
+
|
|
156
|
+
- If `n == 0` and the signer can report `0` (Firefox, Android host): report `0`, write nothing — exactly
|
|
157
|
+
Bitwarden's behaviour.
|
|
158
|
+
- Otherwise report `n + 1` (Chromium: `addCredential signCount = n`; Firefox: `signCount = n + 1`;
|
|
159
|
+
Android host: `n + 1`) and write `n + 1` back right after the assertion.
|
|
160
|
+
|
|
161
|
+
The write-back is a read-modify-write of the whole cipher (`#edit`). Proposed: a dedicated backend method
|
|
162
|
+
that only raises `counter` of the credential with the same id, and is allowed without a TTY (it changes no
|
|
163
|
+
secret and no binding). A failed write-back is reported (`counter_written_back: false`) and makes the next
|
|
164
|
+
sign-in repeat the counter; it is never retried silently. Concurrent use from a Bitwarden client can still
|
|
165
|
+
lose an update **[inference]**; whether `bw edit` rejects stale revisions is unverified.
|
|
166
|
+
|
|
167
|
+
### 4.2 Backup flags (BE/BS)
|
|
168
|
+
|
|
169
|
+
Bitwarden sets BE=1 and BS=1 on every assertion and creation [bw-auth] **[source]**. WebAuthn L3: an RP
|
|
170
|
+
that uses backup state must verify that BE matches the value stored at registration [webauthn-verify]
|
|
171
|
+
**[source]**. Today: Chromium virtual authenticator BE=0 by default (`defaultBackupEligibility` is opt-in)
|
|
172
|
+
**[source]**, Firefox BE=0 (flags `0x05`; its `AddCredential` has no BE/BS parameter) **[observed]**, Android
|
|
173
|
+
host flags `0x05` (BE=0) **[source]**.
|
|
174
|
+
|
|
175
|
+
- Chromium: set `backupEligibility`/`backupState` on `addCredential` and `defaultBackupEligibility`/
|
|
176
|
+
`defaultBackupState` on `addVirtualAuthenticator` [cdp-webauthn] to 1, matching Bitwarden.
|
|
177
|
+
- Android host: flags `0x1D` (UP, UV, BE, BS).
|
|
178
|
+
- Firefox: cannot set BE **[source]**; a Bitwarden-made passkey used through Firefox may be rejected by RPs
|
|
179
|
+
that check BE **[inference]**. Passkeys registered through Firefox would be BE=0 and break in Bitwarden
|
|
180
|
+
clients at those RPs. Record the flag in the item (`blindfill.passkey_be`, readable). Phase 3 refused a
|
|
181
|
+
mismatching path; owner decision 2026-11-27 replaced that: Firefox signs BE=1 passkeys with BE=0 and an
|
|
182
|
+
RP rejection is an ordinary failure (use Chromium). Firefox can set BE once Marionette implements the
|
|
183
|
+
W3C `WebAuthn:SetCredentialProperties` command.
|
|
184
|
+
|
|
185
|
+
### 4.3 Several passkeys
|
|
186
|
+
|
|
187
|
+
The Bitwarden model is one passkey per item, several items per RP. blindfill always loads exactly the one
|
|
188
|
+
item the caller selected (or the one item `resolveItem` finds for the origin), so the browser never chooses
|
|
189
|
+
between blindfill credentials. If the RP sends an `allowCredentials` list that does not contain it, the
|
|
190
|
+
ceremony fails and blindfill reports `not_used` (today's behaviour). Registration takes the RP's
|
|
191
|
+
`excludeCredentials` at face value: the virtual authenticator holds only the new credential, so nothing is
|
|
192
|
+
excluded; duplicates at the RP are the RP's call.
|
|
193
|
+
|
|
194
|
+
### 4.4 RP ID and origin binding
|
|
195
|
+
|
|
196
|
+
Keep today's two blindfill checks (item binds the page; rpId equals the page host or a parent) for both
|
|
197
|
+
ceremonies, then let the browser do the WebAuthn checks. With a virtual authenticator the browser enforces
|
|
198
|
+
"rpId is a registrable suffix of the caller's origin" itself: a page on another site asking for the armed
|
|
199
|
+
rpId was rejected in Chromium and got `SecurityError` in Firefox **[observed]**. Registration reads the
|
|
200
|
+
created credential's rpId back from the browser and refuses to write it unless it equals the rpId blindfill
|
|
201
|
+
checked. Android keeps the package + signer pin and refuses `origin`-populated (browser) callers, as now.
|
|
202
|
+
|
|
203
|
+
## 5. Per browser
|
|
204
|
+
|
|
205
|
+
### 5.1 Chromium (CDP `WebAuthn` domain)
|
|
206
|
+
|
|
207
|
+
`WebAuthn.addVirtualAuthenticator`, `addCredential`, `getCredentials`, events `credentialAdded` /
|
|
208
|
+
`credentialAsserted` [cdp-webauthn] **[source]**. Registration: add an empty authenticator, let the page
|
|
209
|
+
call `navigator.credentials.create()`, wait for `credentialAdded`, read it with `getCredentials` (private
|
|
210
|
+
key, rpId, 32-byte id, `signCount`) **[observed]**, remove the authenticator. The authenticator is scoped to
|
|
211
|
+
the tab: another tab of the same context got `NotSupportedError` **[observed]**. Works for `chromium-launch`
|
|
212
|
+
and `chromium-cdp`, not for providers without CDP (Ego Lite's running instance stays unsupported).
|
|
213
|
+
|
|
214
|
+
### 5.2 Firefox / Camoufox
|
|
215
|
+
|
|
216
|
+
| Option | Status |
|
|
217
|
+
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
218
|
+
| Juggler (Playwright's Firefox protocol) | no WebAuthn domain; nothing in Camoufox 158's `chrome/juggler/` mentions WebAuthn **[observed]** |
|
|
219
|
+
| WebDriver BiDi | no WebAuthn module in the spec (umbrella issue open) [bidi-1154] or in Firefox's BiDi modules **[source]** |
|
|
220
|
+
| WebDriver classic WebAuthn extension | Marionette `WebAuthn:*` commands [ff-marionette]; geckodriver 0.34 added them, 0.36 warned they were unreliable, 0.37.0 (2026-06-03) "full support … Requires Firefox 152 or later" [geckodriver] **[source]** |
|
|
221
|
+
| Playwright 1.61+ `context.credentials` | page-script shim, see §5.3 |
|
|
222
|
+
|
|
223
|
+
Marionette works next to Juggler **[observed]**: Playwright-launched Firefox 159 and Camoufox
|
|
224
|
+
158.0.1-beta.41, both with `args: ['-marionette']` and the two prefs, accepted `WebDriver:NewSession`,
|
|
225
|
+
`WebAuthn:AddVirtualAuthenticator`, `WebAuthn:AddCredential` and `WebAuthn:GetCredentials` on port 2828; the
|
|
226
|
+
Juggler-driven page then signed with the added credential and created a new one; `GetCredentials` returned
|
|
227
|
+
it with its private key. (`marionette.port` set through `firefoxUserPrefs` was ignored; the listener used
|
|
228
|
+
the default 2828.)
|
|
229
|
+
|
|
230
|
+
Constraints **[source + observed]**:
|
|
231
|
+
|
|
232
|
+
- The softtoken pref is global: `WebAuthnService::DefaultService()` sends every WebAuthn request to the
|
|
233
|
+
test token while it is set [ff-service], so **real USB keys stop working in that browser**. Pref changes
|
|
234
|
+
could be scoped to the arm window through Marionette's chrome context **[inference]**.
|
|
235
|
+
- The virtual authenticator is browser-wide: a page in a **different context** used the armed credential
|
|
236
|
+
**[observed]**. Wider than Chromium's per-tab scope; keep the arm short and remove the credential right
|
|
237
|
+
after the first assertion.
|
|
238
|
+
- Firefox only serves WebAuthn to a focused document (`NotAllowedError: CredentialsContainer request is not
|
|
239
|
+
allowed` once another page took focus) **[observed]**.
|
|
240
|
+
- Marionette has no authentication; any local process that connects first gets full browser control,
|
|
241
|
+
including chrome-privileged script. blindfill should open the single Marionette session at attach time
|
|
242
|
+
and hold it, which locks others out (Marionette allows one session) **[inference]**. SECURITY.md treats
|
|
243
|
+
the host as trusted, but this is a new local control port Ollie's setup does not have today.
|
|
244
|
+
- The running Camoufox must be **restarted** with the flag (Camoufox's `launch_server` passes `args` and
|
|
245
|
+
`firefox_user_prefs` through to `launch_options` **[source]**). `navigator.webdriver` stayed `false` in
|
|
246
|
+
Camoufox with Marionette on **[observed]**; other fingerprint effects are unmeasured.
|
|
247
|
+
- The provider needs a second endpoint (Marionette host:port, loopback only) next to the Playwright
|
|
248
|
+
websocket; `firefox-connect` gains a `webauthn` capability.
|
|
249
|
+
|
|
250
|
+
### 5.3 Page-script shim (any browser, including Playwright's `context.credentials`)
|
|
251
|
+
|
|
252
|
+
Playwright 1.61 added `BrowserContext.credentials` [pw-credentials]: an init script replaces
|
|
253
|
+
`navigator.credentials.create/get` in the main world and calls an exposed binding; the Playwright server
|
|
254
|
+
builds `clientDataJSON` and signs in Node [pw-src] **[source]**. It runs on Chromium, Firefox and Camoufox
|
|
255
|
+
**[observed]** (Camoufox 158 launched directly, without the Python launcher; Camoufox documents init scripts
|
|
256
|
+
as isolated [camoufox-stealth], which did not hold in that setup).
|
|
257
|
+
|
|
258
|
+
Not usable as is **[observed]**:
|
|
259
|
+
|
|
260
|
+
- The binding `__pwWebAuthnBinding` is a main-world global. A page on `https://evil.example` called it with
|
|
261
|
+
`origin: 'https://rp.example', rpId: 'rp.example'` and received a valid signature over a
|
|
262
|
+
`clientDataJSON` claiming `https://rp.example`. The server takes `origin` and `rpId` from the page and
|
|
263
|
+
checks neither. That is a cross-origin assertion oracle.
|
|
264
|
+
- `navigator.credentials.get.toString()` is not `[native code]`: any page can detect it, which defeats
|
|
265
|
+
Camoufox's purpose.
|
|
266
|
+
- `credentials.get()` returns private keys to the client, and with `firefox-connect` the key would live in
|
|
267
|
+
the remote Playwright server process.
|
|
268
|
+
|
|
269
|
+
A blindfill-owned shim could fix the first point (take the origin from the binding's source frame, which
|
|
270
|
+
the browser reports, check rpId against it, accept one call while armed, and sign on the host like the
|
|
271
|
+
Android path; the key would then never enter the browser). It still moves WebAuthn's origin and rpId rules
|
|
272
|
+
from the browser into blindfill, remains detectable, and can be raced or wrapped by page scripts that run
|
|
273
|
+
before it. Keep it as the last resort for WebKit only, if ever.
|
|
274
|
+
|
|
275
|
+
### 5.4 WebKit
|
|
276
|
+
|
|
277
|
+
Playwright WebKit has no virtual-authenticator API (feature request closed without one [pw-26621]); only
|
|
278
|
+
the shim above would work **[source + inference]**. Not planned.
|
|
279
|
+
|
|
280
|
+
### 5.5 Android (companion)
|
|
281
|
+
|
|
282
|
+
Registration maps onto the existing arm model [android-provider] **[source]**:
|
|
283
|
+
|
|
284
|
+
1. `blindfill android passkey-register --item --serial` arms the companion (kind `passkey-create`).
|
|
285
|
+
2. `onBeginCreateCredentialRequest` returns one `CreateEntry` ("blindfill: <item>") only while armed and
|
|
286
|
+
only for a `BeginCreatePublicKeyCredentialRequest` whose `rp.id` equals the armed rpId.
|
|
287
|
+
3. The activity reads `ProviderCreateCredentialRequest` (`CreatePublicKeyCredentialRequest`: request JSON,
|
|
288
|
+
optional `clientDataHash`, `CallingAppInfo`), builds `clientDataJSON` with `type: webauthn.create` for
|
|
289
|
+
the app's `android:apk-key-hash:` origin, and sends rp, user, challenge hash, package and signer to the
|
|
290
|
+
host.
|
|
291
|
+
4. The host checks package + signer binding and rpId, generates the P-256 key, writes the vault, builds
|
|
292
|
+
`authData` (flags `0x5D`: UP, UV, BE, BS, AT; counter 0; AAGUID; credential id; COSE key) and a
|
|
293
|
+
`none` attestation object, and returns them. The phone returns
|
|
294
|
+
`CreatePublicKeyCredentialResponse(registrationResponseJson)`.
|
|
295
|
+
|
|
296
|
+
The key never reaches the phone. Browser callers (Chrome on Android with an `origin`) stay refused, as for
|
|
297
|
+
sign-in.
|
|
298
|
+
|
|
299
|
+
## 6. Threat-model differences
|
|
300
|
+
|
|
301
|
+
| Route | Who enforces origin/rpId | Where the key lives during use | Scope while armed | New exposure |
|
|
302
|
+
| -------------------------------- | --------------------------------- | ------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------ |
|
|
303
|
+
| Chromium CDP (today) | browser + blindfill pre-checks | blindfill → Chromium process | one tab, 15 s, one-shot | none new; registration adds a vault write |
|
|
304
|
+
| Firefox Marionette | browser + blindfill pre-checks | blindfill → Firefox process | **whole browser**, 15 s, one-shot | unauthenticated loopback Marionette; real security keys off while prefs set |
|
|
305
|
+
| Android host signing (today) | system package/signer + blindfill | blindfill host only | one armed request | registration adds a vault write |
|
|
306
|
+
| blindfill shim (not recommended) | **blindfill only** | blindfill host only | page, one call | page-detectable; WebAuthn origin rules reimplemented; page scripts can wrap it |
|
|
307
|
+
| Playwright `context.credentials` | **nobody** (page-supplied origin) | Playwright server, returned to client | whole context, unlimited | cross-origin signing oracle **[observed]**; never use |
|
|
308
|
+
|
|
309
|
+
Weakened guarantees: Firefox's browser-wide authenticator widens SECURITY.md item 7 ("any frame of that
|
|
310
|
+
page") to "any page of that browser" during the arm; registration lets an agent add a sign-in method to an
|
|
311
|
+
account (§3.3); counter write-back adds an unattended vault write. Before `bw.#edit` sends an item back it
|
|
312
|
+
registers password, TOTP, card and Hidden-field values with the scrubber (in case `bw` echoes the body), but
|
|
313
|
+
not `fido2Credentials[].keyValue` or SSH keys; add them before any passkey write.
|
|
314
|
+
|
|
315
|
+
## 7. Phases, effort and acceptance
|
|
316
|
+
|
|
317
|
+
| Phase | Scope | Effort | Acceptance |
|
|
318
|
+
| ----- | --------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
319
|
+
| 0 | Spikes (below) | 2 days | each spike answers its question with a recorded result in `docs/TESTED.md` |
|
|
320
|
+
| 1 | Sign-in fixes: counter rule (§4.1), BE/BS (§4.2), scrubber for `keyValue` | 2 days | fake RP verifying counter strictly (SimpleWebAuthn rules) and BE: three sign-ins in a row on Chromium and Android pass; vault counter matches |
|
|
321
|
+
| 2 | Chromium registration: `Engine.passkeyRegister`, CLI `passkey register`, MCP tool, `bw` write | 3 days | fake RP registers, then signs in from the vault in a fresh session; leak test finds no `keyValue` in outputs/audit; refused cases (no opt-in, existing passkey, rpId/origin mismatch) |
|
|
322
|
+
| 3 | Firefox/Camoufox: provider Marionette endpoint, sign-in + registration | 3–4 days | `BLINDFILL_TEST_FIREFOX=1` suite with a Camoufox started like Ollie's (Linux), both ceremonies against the fake RP; other-context and focus cases documented |
|
|
323
|
+
| 4 | Android registration (§5.5) | 3 days | `tests/android-device.test.ts` with the fake RP app on emulator and Xperia: create, then sign in |
|
|
324
|
+
| 5 | Real relying parties | 1–2 days | webauthn.io (no account), then one throw-away account on a real site (e.g. GitHub) chosen by Mics: register, sign out, sign in twice, sign in with the Bitwarden extension |
|
|
325
|
+
|
|
326
|
+
Phase 0 spikes, riskiest first:
|
|
327
|
+
|
|
328
|
+
1. **Bitwarden interop** (blocks the whole format plan): create a passkey with the Bitwarden browser
|
|
329
|
+
extension on webauthn.io, sign in with blindfill (Chromium); then write a blindfill-made `b64.` credential
|
|
330
|
+
with `bw` and sign in with the Bitwarden extension. Checks id encoding, `keyValue`, counter and BE.
|
|
331
|
+
2. **Camoufox on Linux with Marionette**: repeat §8's Firefox script against the Camoufox build and launcher
|
|
332
|
+
Ollie uses (`launch_server` with `args`/`firefox_user_prefs`), in a throw-away profile; measure
|
|
333
|
+
`navigator.webdriver` and a fingerprint test page with and without `-marionette`.
|
|
334
|
+
3. **Counter on a strict RP**: two sign-ins through today's Chromium path against a SimpleWebAuthn-style fake
|
|
335
|
+
RP, expected to fail the second time; confirms the Phase 1 priority.
|
|
336
|
+
|
|
337
|
+
## 8. Experiments run (2026-11-27, owner's Mac, throw-away scripts, not committed)
|
|
338
|
+
|
|
339
|
+
Fake RPs served by `page.route` on `https://rp.example` / `https://evil.example`; fresh profiles; no vault.
|
|
340
|
+
Browsers: Chromium bundled with playwright-core 1.65.1; Playwright Firefox 159.0 (`firefox-1572`); Camoufox
|
|
341
|
+
158.0.1-beta.41 macOS arm64 (from `camoufox fetch`) driven by playwright-core 1.62.0, headless.
|
|
342
|
+
|
|
343
|
+
| Question | Result |
|
|
344
|
+
| --------------------------------------------------------------- | ------------------------------------------------------- |
|
|
345
|
+
| Chromium: counter reported for stored 0 | `1` |
|
|
346
|
+
| Chromium: `create()` then `getCredentials` | works; 32-byte id; private key returned |
|
|
347
|
+
| Chromium: other site asks for armed rpId | rejected |
|
|
348
|
+
| Chromium: other tab of same context | `NotSupportedError` (authenticator is per tab) |
|
|
349
|
+
| Firefox 159 / Camoufox 158: Marionette next to Juggler | works on port 2828 with `-marionette` and the two prefs |
|
|
350
|
+
| Firefox / Camoufox: counter for stored 0, two assertions | `0`, then `1` |
|
|
351
|
+
| Firefox / Camoufox: `create()` then `WebAuthn:GetCredentials` | works; 32-byte id; private key returned |
|
|
352
|
+
| Firefox / Camoufox: other site asks for armed rpId | `SecurityError` |
|
|
353
|
+
| Camoufox: page in another context uses armed credential | **signed** (browser-wide) |
|
|
354
|
+
| Camoufox: `navigator.webdriver` with Marionette session | `false` |
|
|
355
|
+
| Playwright `context.credentials` on Chromium, Firefox, Camoufox | works; binding visible to page; `toString` reveals shim |
|
|
356
|
+
| Playwright `context.credentials`: forged origin from evil page | **valid signature for `https://rp.example`** |
|
|
357
|
+
|
|
358
|
+
Reproduce: launch with Playwright, `firefoxUserPrefs` as in §5.2, connect a TCP client to `127.0.0.1:2828`
|
|
359
|
+
(Marionette framing `len:[0,id,"Command",{params}]`), `WebDriver:NewSession`, then
|
|
360
|
+
`WebAuthn:AddVirtualAuthenticator {protocol:"ctap2_1",transport:"internal",hasResidentKey:true,
|
|
361
|
+
hasUserVerification:true,isUserVerified:true}` and `WebAuthn:AddCredential {authenticatorId, credentials:{…}}`.
|
|
362
|
+
|
|
363
|
+
## 9. Decisions needed from Mics
|
|
364
|
+
|
|
365
|
+
1. **Camoufox**: allow restarting Ollie's Camoufox with `-marionette` and the softtoken prefs (real USB
|
|
366
|
+
security keys off in that browser; local unauthenticated control port), or keep web passkeys
|
|
367
|
+
Chromium-only. Recommendation: allow, after spike 2 passes, with blindfill holding the Marionette
|
|
368
|
+
session.
|
|
369
|
+
2. **Registration without a terminal** on opted-in items, add-only, under the §3.3 rules. Recommendation:
|
|
370
|
+
yes, same footing as `item generate`.
|
|
371
|
+
3. **Counter write-back without a terminal** (counter field only). Recommendation: yes.
|
|
372
|
+
4. **Real-site test account** for Phase 5 (which site, throw-away account, who owns it).
|
|
373
|
+
|
|
374
|
+
Decided by Mics on 2026-11-27:
|
|
375
|
+
|
|
376
|
+
1. Allowed, applied only after spike 2 passes (spike 2 passed the same day on a throw-away Camoufox;
|
|
377
|
+
the shared one was not restarted).
|
|
378
|
+
2. Yes: add-only, without a terminal, on opted-in items; replacing or deleting a passkey needs a terminal.
|
|
379
|
+
3. Yes: counter write-back without a terminal.
|
|
380
|
+
4. GitHub; Mics adds the account to the Vault later (no passkey on it yet).
|
|
381
|
+
|
|
382
|
+
## Sources
|
|
383
|
+
|
|
384
|
+
- [webauthn-verify]: W3C, Web Authentication Level 3, §7.2 Verifying an Authentication Assertion (signature
|
|
385
|
+
counter and BE steps), and §11 automation: https://www.w3.org/TR/webauthn-3/#sctn-verifying-assertion,
|
|
386
|
+
https://www.w3.org/TR/webauthn-3/#sctn-automation
|
|
387
|
+
- [cdp-webauthn]: Chrome DevTools Protocol, WebAuthn domain: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn/
|
|
388
|
+
- [ff-marionette]: Firefox `remote/marionette/webauthn.sys.mjs` and `driver.sys.mjs` (`WebAuthn:*` commands):
|
|
389
|
+
https://github.com/mozilla-firefox/firefox/blob/main/remote/marionette/webauthn.sys.mjs
|
|
390
|
+
- [ff-service]: Firefox `dom/webauthn/WebAuthnService.h` (`DefaultService`), `dom/webauthn/authrs_bridge/src/lib.rs`,
|
|
391
|
+
`modules/libpref/init/StaticPrefList.yaml` (`security.webauth.webauthn_enable_softtoken`):
|
|
392
|
+
https://github.com/mozilla-firefox/firefox/tree/main/dom/webauthn
|
|
393
|
+
- [geckodriver]: geckodriver release notes 0.34.0–0.37.0: https://github.com/mozilla/geckodriver/releases
|
|
394
|
+
- [bidi-1154]: WebDriver BiDi, "WebAuthn as an extension module": https://github.com/w3c/webdriver-bidi/issues/1154
|
|
395
|
+
- [pw-credentials]: Playwright `Credentials` API: https://playwright.dev/docs/api/class-credentials
|
|
396
|
+
- [pw-src]: Playwright `packages/playwright-core/src/server/credentials.ts` and `packages/injected/src/webAuthn.ts`
|
|
397
|
+
(read from the installed playwright-core 1.65.1 bundle): https://github.com/microsoft/playwright
|
|
398
|
+
- [pw-26621]: Playwright, "Configure WebAuthn virtual authenticators in WebKit": https://github.com/microsoft/playwright/issues/26621
|
|
399
|
+
- [camoufox-stealth]: Camoufox stealth overview and main-world evaluation: https://camoufox.com/stealth,
|
|
400
|
+
https://camoufox.com/python/main-world-eval
|
|
401
|
+
- [bw-auth]: Bitwarden `libs/common/src/platform/services/fido2/fido2-authenticator.service.ts`:
|
|
402
|
+
https://github.com/bitwarden/clients/blob/main/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts
|
|
403
|
+
- [bw-credid]: Bitwarden `credential-id-utils.ts`:
|
|
404
|
+
https://github.com/bitwarden/clients/blob/main/libs/common/src/platform/services/fido2/credential-id-utils.ts
|
|
405
|
+
- [simplewebauthn]: SimpleWebAuthn `verifyAuthenticationResponse.ts`:
|
|
406
|
+
https://github.com/MasterKale/SimpleWebAuthn/blob/master/packages/server/src/authentication/verifyAuthenticationResponse.ts
|
|
407
|
+
- [android-provider]: Android, "Integrate Credential Manager with your credential provider":
|
|
408
|
+
https://developer.android.com/identity/sign-in/credential-provider; `BeginCreatePublicKeyCredentialRequest`,
|
|
409
|
+
`CreatePublicKeyCredentialResponse` API reference.
|
|
410
|
+
|
|
411
|
+
[bw-auth]: https://github.com/bitwarden/clients/blob/main/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts
|
|
412
|
+
[bw-credid]: https://github.com/bitwarden/clients/blob/main/libs/common/src/platform/services/fido2/credential-id-utils.ts
|
|
413
|
+
[webauthn-verify]: https://www.w3.org/TR/webauthn-3/#sctn-verifying-assertion
|
|
414
|
+
[simplewebauthn]: https://github.com/MasterKale/SimpleWebAuthn/blob/master/packages/server/src/authentication/verifyAuthenticationResponse.ts
|
|
415
|
+
[cdp-webauthn]: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn/
|
|
416
|
+
[ff-marionette]: https://github.com/mozilla-firefox/firefox/blob/main/remote/marionette/webauthn.sys.mjs
|
|
417
|
+
[ff-service]: https://github.com/mozilla-firefox/firefox/blob/main/dom/webauthn/WebAuthnService.h
|
|
418
|
+
[geckodriver]: https://github.com/mozilla/geckodriver/releases
|
|
419
|
+
[bidi-1154]: https://github.com/w3c/webdriver-bidi/issues/1154
|
|
420
|
+
[pw-credentials]: https://playwright.dev/docs/api/class-credentials
|
|
421
|
+
[pw-src]: https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/credentials.ts
|
|
422
|
+
[pw-26621]: https://github.com/microsoft/playwright/issues/26621
|
|
423
|
+
[camoufox-stealth]: https://camoufox.com/stealth
|
|
424
|
+
[android-provider]: https://developer.android.com/identity/sign-in/credential-provider
|
package/package.json
CHANGED
|
@@ -1,13 +1,82 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blindfill",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Let AI agents sign in to websites without ever seeing the password. Write-only credential actuator with an MCP server, a CLI and pluggable password-manager backends.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"blindfill": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./mcp": {
|
|
18
|
+
"types": "./dist/mcp.d.ts",
|
|
19
|
+
"import": "./dist/mcp.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"docs",
|
|
25
|
+
"README*.md",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"SECURITY.md"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"lint": "tsc --noEmit && eslint . && prettier --check .",
|
|
36
|
+
"format": "prettier --write .",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"browsers": "playwright-core install chromium"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"ai-agent",
|
|
42
|
+
"mcp",
|
|
43
|
+
"mcp-server",
|
|
44
|
+
"password-manager",
|
|
45
|
+
"bitwarden",
|
|
46
|
+
"1password",
|
|
47
|
+
"keepass",
|
|
48
|
+
"playwright",
|
|
49
|
+
"browser-automation",
|
|
50
|
+
"credentials",
|
|
51
|
+
"secrets",
|
|
52
|
+
"llm-security",
|
|
53
|
+
"prompt-injection",
|
|
54
|
+
"agentic",
|
|
55
|
+
"claude-code",
|
|
56
|
+
"autofill"
|
|
57
|
+
],
|
|
6
58
|
"repository": {
|
|
7
59
|
"type": "git",
|
|
8
60
|
"url": "git+https://github.com/mics8128/blindfill.git"
|
|
9
61
|
},
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
64
|
+
"playwright-core": "^1.65.1",
|
|
65
|
+
"tldts": "^7.6.1",
|
|
66
|
+
"zod": "^4.6.7"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@eslint/js": "^10.0.1",
|
|
70
|
+
"@types/node": "^26.6.11",
|
|
71
|
+
"eslint": "^10.15.0",
|
|
72
|
+
"prettier": "^3.10.1",
|
|
73
|
+
"tsup": "^9.0.0",
|
|
74
|
+
"tsx": "^4.23.15",
|
|
75
|
+
"typescript": "^6.0.3",
|
|
76
|
+
"typescript-eslint": "^8.74.0",
|
|
77
|
+
"vitest": "^5.1.2"
|
|
78
|
+
},
|
|
79
|
+
"optionalDependencies": {
|
|
80
|
+
"playwright-core-compat": "npm:playwright-core@1.62.0"
|
|
81
|
+
}
|
|
13
82
|
}
|