Skip to content

Reject the KEX requests a client never receives - #1222

Merged
ejohnstown merged 1 commit into
wolfSSL:masterfrom
gasbytes:zd-22394-follow-up
Sep 2, 2026
Merged

Reject the KEX requests a client never receives#1222
ejohnstown merged 1 commit into
wolfSSL:masterfrom
gasbytes:zd-22394-follow-up

Conversation

@gasbytes

@gasbytes gasbytes commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This is just a follow-up PR to (#1221), that mirrors pretty much the same changes for the client side too.

Addresses some post merge feedback received from @ejohnstown.

This is just a follow-up PR to (wolfSSL#1221), that mirrors pretty much the same changes for the client side too.
@gasbytes gasbytes self-assigned this Sep 2, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped, aligns with the protocol message directionality, and is backed by targeted regression tests covering both the new client-side blocks and a “do not over-block” case.

Pull request overview

This PR extends the “reject peer-only KEX messages” hardening from #1221 to the client side, ensuring a malicious server cannot send client-only key exchange messages to trigger unnecessary or unsafe processing.

Changes:

  • Added client-side message gating to always reject client-only KEX message IDs (30/32/34) when received.
  • Added a regression test TestClientOnlyKexMsgsBlocked validating these KEX messages are rejected on the client, while the expected server message (31) remains allowed in the correct state.
  • Expanded the existing server-side regression test to assert that message ID 32 remains allowed when expected (i.e., not over-blocked between blocked IDs).
File summaries
File Description
tests/regress.c Adds client-side regression coverage for blocking client-only KEX messages and refines server-side coverage to ensure msg 32 remains permitted when expected.
src/internal.c Updates client receive-side gating to reject client-only KEX messages (30/32/34) and clarifies the server-side comment for msg 31 aliasing.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@gasbytes

gasbytes commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Jenkins retest this please (invalid stream header)

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #1222

Scan targets checked: wolfssh-bugs, wolfssh-src

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

@ejohnstown
ejohnstown merged commit 6802df0 into wolfSSL:master Sep 2, 2026
166 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.

4 participants