fix: prevent coderd crashes from unsupported Tailnet RPCs by geokat · Pull Request #28429 · coder/coder · GitHub
Skip to content

fix: prevent coderd crashes from unsupported Tailnet RPCs - #28429

Merged
geokat merged 1 commit into
mainfrom
george/plat-464/prevent-coderd-crashes-from-unsupported-tailnet-rpcs
Sep 3, 2026
Merged

fix: prevent coderd crashes from unsupported Tailnet RPCs#28429
geokat merged 1 commit into
mainfrom
george/plat-464/prevent-coderd-crashes-from-unsupported-tailnet-rpcs

Conversation

@geokat

@geokat geokat commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Workspace agents could call RefreshResumeToken and WorkspaceUpdates, even though agent connections do not configure the providers those RPCs require. The resulting nil dereference panicked a DRPC handler and crashed coderd.

Limit the agent Tailnet surface to its supported RPCs, return Unimplemented when optional providers are absent, and recover panics in Coder-owned DRPC servers so they return an internal error instead of crashing the process.

Refs: https://linear.app/codercom/issue/PLAT-464

@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

@geokat
geokat force-pushed the george/plat-464/prevent-coderd-crashes-from-unsupported-tailnet-rpcs branch from 1560d81 to 7630cbb Compare August 21, 2026 01:34
@geokat
geokat marked this pull request as ready for review August 21, 2026 01:45
@geokat
geokat requested review from Emyrk, deansheather and jdomeracki-coder and removed request for deansheather August 21, 2026 01:45

@dylanhuff-at-coder dylanhuff-at-coder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Went through this pretty closely. The Tailnet allowlist is the right shape, the unsupported RPCs fail closed, and the recovery test proves the connection stays usable after a panic. lgtm

Workspace agents could call Tailnet RPCs whose providers were nil,
causing a panic in a DRPC handler and terminating coderd.

Restrict agent connections to supported Tailnet RPCs and return
Unimplemented when optional providers are unavailable. Wrap Coder DRPC
servers with panic recovery so a future handler panic returns an
internal error instead of crashing the process.

Add wire-level and agent-RPC regression coverage.

Refs: https://linear.app/codercom/issue/PLAT-464
@geokat
geokat force-pushed the george/plat-464/prevent-coderd-crashes-from-unsupported-tailnet-rpcs branch from 7630cbb to 75ff75d Compare September 3, 2026 20:10
@geokat
geokat merged commit 156c8b6 into main Sep 3, 2026
28 checks passed
@geokat
geokat deleted the george/plat-464/prevent-coderd-crashes-from-unsupported-tailnet-rpcs branch September 3, 2026 20:29
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 3, 2026
@geokat geokat added backport backport/v2.36 Backport PR targeting release/2.36 and removed backport/v2.36 Backport PR targeting release/2.36 labels Sep 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants