openpencil/.github/workflows
Kayshen-X f9f9c8574a fix(collab): harden p2p collaboration against resource exhaustion
Addresses a security review of the collaboration subsystem. No auth
bypass, key leak, or document-plaintext exposure was found; every
finding below is availability or trust-boundary hardening.

Landed as one commit because the pieces are not separable: the
inbound-direction ceiling spans op-collab, op-collab-transport, and the
desktop host atomically, the guarded accept spans transport, smoke, and
the desktop host, and the boundary-gate rules only hold against the
final state. Splitting would produce commits that fail to build or fail
the gate.

Relay server (public, internet-facing):
- Charge pre-pairing capacity per source address. The auth-concurrency
  semaphore was taken before the WebSocket upgrade and the peer address
  was discarded, so one host could pin every permit by connecting and
  going silent.
- Give renewals their own budget. Reauthentication competed for the same
  semaphore, so an unauthenticated flood progressively closed live
  tunnels with a policy error.
- Release the pair registration when the ready status fails to send; the
  counterpart only reclaims it if it reads its pairing notice.
- Require the X25519 key file to be owned by the running user; mode bits
  alone do not establish trust.
- Summarise capacity rejections instead of logging one line each.

Locator service:
- Rate-limit publishes per client instead of process-wide. One
  unauthenticated caller could consume the whole budget and 429 every
  tenant's invite issuance.

Collaboration protocol:
- Size the inbound envelope ceiling from the authenticated remote role
  rather than sharing the 64 MiB snapshot ceiling in both directions, so
  an admitted guest cannot force a 64 MiB JSON parse per frame. The
  ceiling is applied before the discriminator and before the generic
  value decode; a peer-declared snapshot kind cannot raise it.
- Reject display names carrying Unicode format characters, which render
  identically to an existing participant's name.
- Reject avatar URLs pointing at non-globally-routable addresses.

Transport:
- Reclaim a pending-handshake seat from a peer that has not produced a
  valid first handshake message, and raise the global ceiling. Sixteen
  seats held for the full handshake window let four addresses deny every
  join.
- Put inbound reassembly under an aggregate budget; only the outbound
  aggregate was bounded.
- Stop heartbeats from refreshing the idle deadline in receive_transfer.
- Filter IPv4 link-local discovery advertisements, matching IPv6.

Relay client and trust roots:
- Bound server-initiated reauthentication per connection by count and
  minimum interval, sized from the protocol's own cadence.
- Close the policy-file TOCTOU window by identity-checking the opened
  file, and reject group/world-writable or foreign-owned policy files.
- Stop discarding bootstrap cache-write failures, which silently
  disabled the anti-rollback generation floor.
2026-08-01 09:48:23 +08:00
..
collab-platform-acceptance.yml feat(collab): add authenticated p2p collaboration 2026-07-29 00:06:58 +08:00
collab-security.yml fix(collab): harden p2p collaboration against resource exhaustion 2026-08-01 09:48:23 +08:00
nix-check.yml fix(web): pre-open the sign-in popup in the click gesture and use popup wording 2026-07-25 23:51:27 +08:00
rust-check.yml fix(ci): gate windows test text measurement 2026-07-08 02:00:47 +08:00
rust-multiplatform.yml fix(ci): retry ARM apt prerequisites 2026-07-15 23:22:22 +08:00
rust-release.yml feat(collab): add authenticated p2p collaboration 2026-07-29 00:06:58 +08:00
version-sync.yml feat(collab): add authenticated p2p collaboration 2026-07-29 00:06:58 +08:00
vscode-extension.yml ci(vscode): trigger on workspace-root dependency changes too 2026-07-19 20:41:37 +08:00
wasm-bundle-build.yml merge: land the align-branch work onto the refreshed base 2026-07-03 00:08:17 +08:00
wasm-bundle-check.yml feat(collab): add authenticated p2p collaboration 2026-07-29 00:06:58 +08:00
web-sdk-bundle.yml merge: land the align-branch work onto the refreshed base 2026-07-03 00:08:17 +08:00