Repository navigation
Gate dynamic pairing on a pairing window - #361
Conversation
A man in the middle between server and client can pair with the server under the client's name, then drive the client's display or speaker through a role so it shows or speaks the attacker's pairing code as artwork or audio. The operator reads it off the client, enters it into the server, and the server pairs with the attacker. Commit-and-reveal binding does not help: the code is never generated on the client. The client must now emit the code only where no server can forge it: through an out-channel no server can drive, or through a shared one only during an attempt gated by a pairing window. While the window is open the client suspends all server-driven output on that channel and shows only pairing state. The window closes solely on a completed pairing, an operator gesture on the client, or expiry; nothing a server sends, including an abort or a dropped connection, releases it. Pairing Window becomes a shared section covering both code flows
maximmaxim345
left a comment
There was a problem hiding this comment.
@kahrendt @chrisuthe what do you think about this? I'm a bit split on this one. The attack is possible before this PR and this PR closes that gap, but IMO it also impacts the user experience around pairing in a substantial way since every dynamic pairing now needs a gesture on the client first, and the client stops all playback while the window is open.
Pairing is already a pain point and the attack needs quite a setup, so I'm leaning more toward the user experience side.
Artur and I were already thinking about how to solve this without a UX trade-off, but we couldn't come up with anything else (except for my idea of only requiring the gesture with unpaired access enabled). I'd like to hear your thoughts and ideas on this.
No matter if we go with this, I think the sendspin-cpp-cli installer should also ask the user if they want unpaired access enabled (I'd even default to enabled), and with this PR even more so, since every pairing then needs a sendspin-cli pair confirm on the player's host.
From the technical side, I'm also not sure if this is (easily) possible to implement in sendspin-python-cli, but that client is more or less deprecated, so this should not sway the decision.
| - **Window lifetime.** From window opening, without pausing during attempts. Recommended 5 minutes. On expiry, the window closes silently. An attempt already in progress runs to its own end, but starting another requires a new pairing window. | ||
| - **Signal to the server.** The client sends [`client/pair-init`](#client--server-clientpair-init) once the window is open and the [`server/activate`](messaging.md#server--client-serveractivate) has arrived; while a gesture is awaited it signals [`client/pair-pending`](#client--server-clientpair-pending), optionally naming the gesture in `message`. The server MUST NOT send [`server/pair-auth`](#server--client-serverpair-auth) until it has received `client/pair-init`. | ||
| - **Signal to the server.** The client sends [`client/pair-init`](#client--server-clientpair-init) once the window is open and the [`server/activate`](messaging.md#server--client-serveractivate) has arrived; while a gesture is awaited it signals [`client/pair-pending`](#client--server-clientpair-pending), optionally naming the gesture in `message`. The server MUST NOT send [`server/pair-auth`](#server--client-serverpair-auth) or [`server/pair-init`](#server--client-serverpair-init) until it has received `client/pair-init`. | ||
| - **Out-channel hold.** A client that offers `dynamic_pairing_code` MUST suspend all server-driven output, not only on the emitting out-channel, while a window is open or an attempt it gates is in progress, emitting nothing but pairing state: the code during a dynamic attempt, otherwise its pairing state, such as that it is waiting (see [Forged emission](#dynamic-pairing-code-flow)). |
There was a problem hiding this comment.
From a user perspective this has the potential to feel broken: after a pairing that was cancelled or failed, the speaker stays silent until the window expires or the operator cancels it on the device. I understand why a server can't release it if we want to close this, but that can be up to 5 minutes of silence after pressing cancel in the server.
There was a problem hiding this comment.
If the client has a screen, then it keeps showing that it's in pairing mode on there; if it has a speaker, then it can say something like "Currently pairing"; if it has some LEDs, it can flash them a distinct colour, etc.
In any case I think that's an implementation detail, so should go to the implementation guide?
There was a problem hiding this comment.
The only lever that we have here is the timeout and I feel that 5 minutes is already on the short side. It's only a recommendation though, so a client can still pick a shorter one.
|
I see the UX cost, but I don't think we can trade against this one, because the attack is fundamental. It completely breaks dynamic pairing: the server passes every check and still ends up paired with the attacker.
Not from a security perspective. The attacker only needs a device on the same network while someone is pairing: it advertises a client with the same name over mDNS and connects to the real device as a server. That's the same attacker the rest of our pairing was designed to defend against.
I don't think that works, for two reasons. First, the attack doesn't actually need unpaired access: a paired server can do the same thing, and a paired server should never be able to impersonate the client to another server (although that's obviously much less impactful in practice). Second, the server couldn't tell when to ask for the gesture, because it only learns that setting from its peer, which in this case is the attacker.
I might be missing something here, but don't you already have to run a command on the host to read the code? So |
|
We discussed it as a team and determined the PR is OK to proceed, so I'm going to merge. |
Gate dynamic pairing on a pairing window.
A man in the middle can pair with the server under a client's name, then drive the real client's display or speaker through a role so it shows or speaks the attacker's code. The operator reads it off the device and the server pairs with the attacker. Our pairing protections do not help: the client never enters pairing and the code is never generated on it.
Changes to the pairing section:
No wire changes.