Skip to content

fix(server): add 10s timeout to TLS handshake#651

Closed
persimmon16 wants to merge 1 commit intoNVIDIA:mainfrom
persimmon16:fix/tls-handshake-timeout
Closed

fix(server): add 10s timeout to TLS handshake#651
persimmon16 wants to merge 1 commit intoNVIDIA:mainfrom
persimmon16:fix/tls-handshake-timeout

Conversation

@persimmon16
Copy link
Copy Markdown

Summary

  • Wraps the TLS accept() call with a 10-second tokio::time::timeout to prevent slowloris-style attacks
  • Connections that fail to complete the TLS handshake within 10s are dropped with a debug log

Related Issue

Production readiness audit finding (P1): no timeout on TLS handshake — a malicious client could hold a connection open indefinitely.

Changes

  • crates/openshell-server/src/lib.rs: Wrapped tls_acceptor.inner().accept(stream) with tokio::time::timeout(Duration::from_secs(10), ...)

Testing

  • cargo check -p openshell-server passes
  • 10s is generous for legitimate clients while preventing indefinite hangs

Checklist

  • Conventional commit format
  • No secrets committed
  • Scoped to the issue at hand

@persimmon16 persimmon16 requested a review from a team as a code owner March 28, 2026 19:54
@github-actions
Copy link
Copy Markdown

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@github-actions
Copy link
Copy Markdown

Thank you for your interest in contributing to OpenShell, @persimmon16.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions github-actions bot closed this Mar 28, 2026
@persimmon16 persimmon16 deleted the fix/tls-handshake-timeout branch March 28, 2026 19:56
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