Skip to content

Userauth none bypasses wolfSSHd credential check#940

Merged
padelsbach merged 1 commit intowolfSSL:masterfrom
ejohnstown:allow-userauth-none
Apr 21, 2026
Merged

Userauth none bypasses wolfSSHd credential check#940
padelsbach merged 1 commit intowolfSSL:masterfrom
ejohnstown:allow-userauth-none

Conversation

@ejohnstown
Copy link
Copy Markdown
Contributor

@ejohnstown ejohnstown commented Apr 20, 2026

When wolfsshd is built with WOLFSSH_ALLOW_USERAUTH_NONE, the DefaultUserAuth() function accepted WOLFSSH_USERAUTH_NONE as a valid auth type and forwarded it to RequestAuthentication(). Since RequestAuthentication() only gates credential checks on PASSWORD and PUBLICKEY types, a none request for any existing system user returned success without verifying any credential. Removed USERAUTH_NONE as an accepted auth type in DefaultUserAuth() so it is treated as an invalid auth type for wolfsshd.

I want to emphasize, you have to build with the flag WOLFSSH_ALLOW_USERAUTH_NONE for this to be a problem.

Affected function: DefaultUserAuth.
Issue: F-3215

Copilot AI review requested due to automatic review settings April 20, 2026 23:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes an authentication bypass in wolfSSHd when built with WOLFSSH_ALLOW_USERAUTH_NONE by preventing USERAUTH_NONE from being treated as an acceptable auth method in the server’s default auth handler.

Changes:

  • Reject WOLFSSH_USERAUTH_NONE in DefaultUserAuth() by removing it from the accepted auth-type allowlist.
  • Clarify behavior via a comment noting WOLFSSH_USERAUTH_NONE is not valid for wolfSSHd.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/wolfsshd/auth.c
Comment thread apps/wolfsshd/auth.c Outdated
When wolfsshd is built with WOLFSSH_ALLOW_USERAUTH_NONE, the
DefaultUserAuth() function accepted WOLFSSH_USERAUTH_NONE as a valid
auth type and forwarded it to RequestAuthentication(). Since
RequestAuthentication() only gates credential checks on PASSWORD and
PUBLICKEY types, a none request for any existing system user returned
success without verifying any credential. Removed USERAUTH_NONE as an
accepted auth type in DefaultUserAuth() so it is treated as an invalid
auth type for wolfsshd.

Affected function: DefaultUserAuth.
Issue: F-3215
@ejohnstown ejohnstown force-pushed the allow-userauth-none branch from 2cbef50 to 290aae2 Compare April 20, 2026 23:51
@padelsbach padelsbach merged commit 87c0b05 into wolfSSL:master Apr 21, 2026
131 checks passed
@ejohnstown ejohnstown deleted the allow-userauth-none branch April 21, 2026 16:35
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