Skip to content

security: recover() in handshake connection handler + common v0.5.9 (panic-DoS) - #29

Merged
TeoSlayer merged 1 commit into
mainfrom
security/panic-guard
Jul 25, 2026
Merged

TeoSlayer merged 1 commit into
mainfrom
security/panic-guard

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

A wrong-length public_key in a handshake message made ed25519.Verify panic; handleConnection runs in its own goroutine, so an unrecovered panic crashes the daemon (remote, unauthenticated). Fixed at the root in common v0.5.9 (crypto.Verify length guard) and added a recover() here as defense-in-depth. Tests green.

🤖 Generated with Claude Code

…hardening)

The handshake decodes a peer-supplied public_key and calls crypto.Verify;
a wrong-length key made ed25519.Verify panic, and handleConnection runs
in its own goroutine — an unrecovered panic there crashes the daemon.
common v0.5.9 makes crypto.Verify reject wrong-length keys (root fix);
the recover() is defense-in-depth against any future panic in this
unauthenticated path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TeoSlayer
TeoSlayer merged commit e57aadb into main Jul 25, 2026
4 checks passed
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