internal: refuse auth replies before a request - #1290
Draft
ejohnstown wants to merge 1 commit into
Draft
ejohnstown wants to merge 1 commit into
ejohnstown wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The state transition fix is focused and comprehensively covered by regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Prevents clients from accepting user-authentication messages before sending their first authentication request, addressing issue #1285.
Changes:
- Tightens client message-state validation for user-authentication messages.
- Adds regression coverage for unsolicited replies and valid banner sequencing.
| File | Description |
|---|---|
src/internal.c |
Delays user-auth message acceptance until the request is sent. |
tests/regress.c |
Tests rejection, disconnect behavior, and banner handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The client filter now refuses every userauth message, the banner included, until CONNECT_CLIENT_USERAUTH_SENT, so a SUCCESS sent in place of the SERVICE_ACCEPT no longer completes wolfSSH_connect(). The first request goes out right after the service accept, RFC 4252 section 5.4. - regress: test each userauth message in the pre-request states - regress: drive an early SUCCESS, FAILURE and PK_OK through DoReceive - regress: a banner bundled behind the service accept still gets through wolfSSH_connect() Issue: wolfSSL#1285
ejohnstown
force-pushed
the
issue-1285-unsolicited-auth-success
branch
from
October 1, 2026 16:39
34ce773 to
9b8d721
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The client refuses every userauth message, the banner included, until its first USERAUTH_REQUEST is out, so a SUCCESS sent in place of the SERVICE_ACCEPT no longer completes wolfSSH_connect().
Issue: #1285