Repository navigation
internal: refuse an unsolicited INFO_RESPONSE - #1361
Open
ejohnstown wants to merge 1 commit into
Open
ejohnstown wants to merge 1 commit into
ejohnstown wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A post-flush callback error can leave kbSetupPending unset after an INFO_REQUEST is fully delivered, causing a legitimate peer response to be rejected if processing continues.
1 open issue
What changed in this PR
This PR hardens server-side keyboard-interactive authentication by rejecting INFO_RESPONSE messages when no INFO_REQUEST is outstanding.
Changes:
- Add an outstanding-request check and preserve pending state across blocked authentication callbacks.
- Add unit coverage for unsolicited responses, completed rounds, and pending retries.
- Update regression fixtures to mark simulated INFO_REQUESTs as outstanding.
| File | Description |
|---|---|
| tests/unit.c | Add response-state and pending-retry tests. |
| tests/regress.c | Set outstanding-request state in response fixtures. |
| src/internal.c | Reject unsolicited responses and manage pending exchange state. |
Review effort: Balanced
The server takes a keyboard-interactive INFO_RESPONSE only while an INFO_REQUEST is outstanding, and refuses any other as fatal, as it does one outside keyboard-interactive auth. A response kept for redispatch on WS_AUTH_PENDING keeps the exchange outstanding. - DoUserAuthInfoResponse() requires kbSetupPending and clears it only once the response is consumed, not on WS_AUTH_PENDING - SendUserAuthKeyboardRequest() arms it once the request is delivered, even if the highwater callback then fails; a blocked setup re-arms it - unit: unsolicited responses after no request, a declined setup, and failed or partial rounds; would-block retries; a highwater failure - regress: the INFO_RESPONSE harness marks the exchange outstanding Issue: F-17085
ejohnstown
force-pushed
the
kb-info-response-state
branch
from
November 2, 2026 20:51
a97ce48 to
8e259f2
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1361
Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 1 of 3 in-scope changed file(s) opened by the reviewer; not opened: tests/regress.c, tests/unit.c
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
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 server takes a keyboard-interactive INFO_RESPONSE only while an
INFO_REQUEST is outstanding, and refuses any other as fatal.
that would block re-arms it
Issue: F-17085