Repository navigation
Cosign 0.12.9
Cosign 0.12.9
Two security fixes, both found by red teams on design documents that were reading this code for
other reasons. One is live and this release closes part of it; the other is latent and closed
outright. The scope of each is stated plainly below, because the first is a partial fix and a
release note that said otherwise would be wrong.
A joining phone needed a piece from the device whose invite you scanned — partial
Live finding 17. A phone joining an existing key has no member list yet, so welcome and
sigma are routed before any sender check — and nothing checked the sender afterwards either. From
one message the joining phone took the whole group: the key, the npub, the threshold, every member
and every point. need came out of that same message, so helpers: [x] made a single message a
complete enrollment. The invite carries only a pk and relays, and a join request's own pubkey is in
the clear on a public relay, so this was not a dishonest server's attack — anyone watching those
relays could answer, and the honest flow needs a welcome plus two sigmas, so an attacker won the
race without trying. The phone then held a share of a key the attacker controlled alone, and the
only cue was a truncated npub in a note.
Every piece now carries the pk that sent it, and for each new share one of them must come from the
inviter in the code the person scanned on this device. That pk is the only thing a scan
authenticates; the vouching device already sends its sigmas straight to the joining device; and an
attacker cannot stand in for it without that device's shares. Plus a floor of two distinct senders,
whatever helpers claims, so one message is never a quorum again.
What this does not close, and it is the path most joins take. The condition needs a scanned
inviter pk, which only exists when joining by someone else's cosign:invite — and the only thing
that produces one of those is the browser extension. A phone showing its own join code
(cosign:join) scans in the other direction: the existing device authenticates the joining one, and
the joining one learns nothing about who answers. The two-sender floor applies there and an attacker
with two keys satisfies it. So phone-to-phone joining is still exposed. Closing it needs the
joining device to have a first-hand copy of the group key, which means showing the npub and having
the person compare it — a screen, and a decision about how it should feel, not a condition that can
be added quietly.
The other half of the protection was already present and this release does not add a second copy of
it: repair_step3 verifies the repaired share against the commitment of the group it was handed, so
a sum that does not lie on that key's polynomial is refused by the library. The attack works only
because an attacker that supplies every piece supplies a consistent set. Forcing one honest piece
into the sum is what makes the library's own check bite.
A decryption partner must send a piece for every share it holds — latent
Each Chaum–Pedersen proof released in 0.12.7 speaks for one index and nothing else, and nothing
checked that a partner's parts covered its shares. A partner holding three that sent two passed
every check there was — each part verified, and comparing how many were checked against how many
were sent compares the answer against itself. The combined point was then one short, ecdhCombine
refuses only the identity, and the result was a value that is nobody's conversation key: a MAC
failure wherever the plaintext was wanted, with no member named, because every proof passed. A
repeated index did the same from the other side.
The set of indices in parts must now equal the partner's shares exactly, compared as sorted lists
so a duplicate is refused as well as a missing one. A partner that sends anything else is a partner
that failed, by name, and the next one gets a turn. Both sides: the server's frostEcdh and the
phone's sharedX, whose own check compared the answer against itself.
Latent rather than live, and the finding says so. It needs a partner that holds more than one
share and answers ecdh_req. A server holds one, so its answer is one part; a current device
refuses the request outright (§5.6); a paper backup holds two and is not a running process. It
becomes reachable with a device old enough to still answer. Fixed anyway, because it is one
condition, it fails closed, and the failure mode it closes is the one this code could not report.
The live half of the same lines is not fixed, and it is a compatibility decision rather than a
patch: verification is skipped entirely when a partner answers with an empty parts array, so the
proof regime is optional at the answering partner's choosing. Removing that branch means stating a
version floor. Written up as finding 16(a).
Where the phone fix reaches people
android/cosign is a submodule that Marble consumes, so the joining-phone fix reaches a phone only
through a Marble release. This release carries the protocol, the server image and the signing
libraries.
Tests
server/test/ecdh-cover.ts (10 checks) shows the wrong key with real crypto rather than asserting
it away. JoinWelcomeTest records the two facts the join fix rests on: an attacker supplying every
piece is not caught by the library, and one honest piece in the sum and it is. 32 Kotlin unit tests,
dleq, share-points, ecdh-cover, guards.e2e and create.e2e all pass; tsc clean.
Cosign 0.12.9: the protocol, the server and the signing libraries.
The server image is ghcr.io/sybenx/cosign-server:0.12.9 (also :0.12 and :latest), for amd64 and arm64. Running one: docs/servers.md. Marble, the Android app, is released from https://github.com/sybenx/marble.