Skip to content

Protocol v0#46

Open
reynoldskr wants to merge 1 commit intomainfrom
dev/kreynolds/protocol
Open

Protocol v0#46
reynoldskr wants to merge 1 commit intomainfrom
dev/kreynolds/protocol

Conversation

@reynoldskr
Copy link
Contributor

No description provided.

@sonarqubecloud
Copy link

@github-actions
Copy link

Logo
Checkmarx One – Scan Summary & Details0033edaf-97d6-4b46-9a30-828c819084fd

Great job! No new security vulnerabilities introduced in this pull request

@reynoldskr reynoldskr requested a review from abergs March 12, 2026 03:43
Commands:
connect Connect to a remote device (default)
listen Listen for incoming connections
cache Manage session cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should document the CLI interface here. It's too fast moving and hard to keep up to date.

| **User Client** | Trusted device (e.g., laptop with Bitwarden vault). Listens for incoming connections, approves requests, and serves credentials. |
| **Remote Client** | Untrusted device requesting credentials. Initiates connections and sends credential requests. |
| **Proxy Server** | WebSocket relay. Authenticates clients, facilitates peer discovery (rendezvous), and routes encrypted messages. Cannot decrypt payloads. |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like the term "device", but struggle with coming up with another name.

And I'm not sure I like the Trusted/Untrusted monicker.

We're really trying to represent:
User Client -- attached to a vault/password manager and is reponsible for answering requests (Approval etc) and can access passwords.
Remote Client - Does not have access to the vault/password manager, except through sending requests to the UserClient.

Maybe "User Client" should be "Vault Client"... or "ContentClient" etc etc?

Naming is hard, but let's start with removing the terms device and trusted/untrusted.

Note: We can keep "device" for the "Multi-device" references later in this doc.

## 1. Overview

The Bitwarden Remote Access Protocol enables secure peer-to-peer credential sharing between a **User Client** (trusted device holding credentials) and a **Remote Client** (untrusted device requesting credentials). Communication is relayed through a **Proxy Server** that operates with zero knowledge of message contents.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment about device/trusted device, try to apply it. Although the references makes more sense here.

}
```

- **Format**: 6 alphanumeric characters with hyphen separator (e.g., `"ABC-DEF"`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rendevouz tokens are now 9 chars + 2 hypens.

}
```

**Server cleanup**: Background task runs every 60 seconds, removing expired entries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to document how the server cleans up in the protocol def.


bw-proxy (WebSocket relay server binary)
└── bw-proxy-protocol
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we will tweak crates names to remove the bw-prefix.

- Signature verification fails → drop connection
- Timeout (>5s) → drop connection

### 5.3 Phase 2: Rendezvous (Optional)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Phase 2 is discovery + handshake?

And we need to clarify that there are two methods, Rendevouz + PSK.

And it's not really optional, but you can pick which mode you prefer.

**Send-side** (time-triggered):
- Every `rekey_interval` seconds (default: 86,400 = 24 hours)
- New key derived: `new_key = XChaCha20-Poly1305_Encrypt(old_key, nonce=0xFF×24, plaintext=0x00×32)`
- `send_rekey_counter` incremented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about this? Let's verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants