Skip to content

fix: harden R Console session transports and persistence - #58

Merged
Fred-Wu merged 10 commits into
mainfrom
fix/secure-console-session-transport
Oct 27, 2026
Merged

Fred-Wu merged 10 commits into
mainfrom
fix/secure-console-session-transport

Conversation

@Fred-Wu

@Fred-Wu Fred-Wu commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Security

  • Authenticate persistent R backend TCP clients before replacing the active session, bound unauthenticated clients and reject oversized protocol frames.
  • Store per-session credentials in restricted VS Code persisted state instead of temporary bootstrap files.
  • Authenticate R language-server TCP connections before accepting LSP traffic.
  • Restrict Unix sess socket directories, cap proxy message buffering, and constrain legacy watcher HTTP connections to loopback.
  • Persist session metadata atomically with restrictive permissions.

Tests

  • Rust frame authentication and size-limit tests
  • Node protocol, LSP authentication, sess proxy and legacy watcher tests
  • Real R smoke test for unauthenticated clients, stalled handshakes, serialized reconnect, and shutdown

Compatibility

Legacy detached sessions created before authentication need to be closed using the older extension before upgrading.

Draft until cross-platform CI and merge review pass.

@Fred-Wu
Fred-Wu force-pushed the fix/secure-console-session-transport branch 9 times, most recently from eb0fccf to df61243 Compare October 26, 2026 10:51
@Fred-Wu
Fred-Wu force-pushed the fix/secure-console-session-transport branch 6 times, most recently from 1acef6d to 3f4de29 Compare October 26, 2026 15:06
@Fred-Wu
Fred-Wu force-pushed the fix/secure-console-session-transport branch from 3f4de29 to d3fe5b7 Compare October 26, 2026 15:22
@Fred-Wu
Fred-Wu force-pushed the fix/secure-console-session-transport branch from 778300b to 039c304 Compare October 26, 2026 23:45
@Fred-Wu
Fred-Wu force-pushed the fix/secure-console-session-transport branch from 4e7e501 to 10aef61 Compare October 27, 2026 00:37
@Fred-Wu
Fred-Wu marked this pull request as ready for review October 27, 2026 05:24
Resume TCP LSP reads only after the JSON-RPC reader is listening, preserving buffered messages. Bound every backend authentication read and write by one absolute deadline and clear timeouts before session handoff.

Add production-transport and drip-fed header/payload regressions to the existing cross-platform Node and Rust CI suites. Verified that the regressions fail against the previous behavior; all 218 Node tests, 10 Rust tests, and extension type-check/bundle pass locally.
@Fred-Wu Fred-Wu self-assigned this Oct 27, 2026
@Fred-Wu
Fred-Wu merged commit 46dbe77 into main Oct 27, 2026
15 of 21 checks passed
@Fred-Wu
Fred-Wu deleted the fix/secure-console-session-transport branch October 27, 2026 14:17
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.

1 participant