Skip to content

Equalize crypt() cost when password auth is rejected early - #1116

Merged
ejohnstown merged 1 commit into
wolfSSL:masterfrom
stenslae:pr-timing-oracle
Aug 5, 2026
Merged

Equalize crypt() cost when password auth is rejected early#1116
ejohnstown merged 1 commit into
wolfSSL:masterfrom
stenslae:pr-timing-oracle

Conversation

@stenslae

@stenslae stenslae commented Jul 21, 2026

Copy link
Copy Markdown
Member
  • DoFakePasswordCheck() runs a cost-matched dummy crypt() on the RequestAuthentication() paths that reject before the real check.
  • CheckPasswordHashUnix() no longer short-circuits on a locked or empty stored hash.
  • wolfSSHD_AuthInit() caches up to 8 salt-only templates from /etc/shadow at startup, before the privilege drop.
  • CheckPasswordUnix() fails closed on NULL sp_pwdp and over-long hashes.
  • 25 new test_configuration cases; it moves to check_PROGRAMS so CI runs it.
  • Measured on $6$: gap drops from +258 ms to -6 ms. Not covered: yescrypt (~+673 ms, unchanged), PAM, and DefaultUserAuthTypes() advertising no methods for unknown users.

@stenslae stenslae self-assigned this Jul 21, 2026

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.h Outdated
Comment thread apps/wolfsshd/auth.h Outdated

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.c
Comment thread apps/wolfsshd/auth.c
@stenslae
stenslae requested review from wolfSSL-Fenrir-bot and removed request for wolfSSL-Fenrir-bot July 23, 2026 17:11

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.c
Comment thread apps/wolfsshd/auth.c

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

No new issues found in the changed files. ✅

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

No new issues found in the changed files. ✅

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.h Outdated
Comment thread apps/wolfsshd/auth.h Outdated
Comment thread apps/wolfsshd/auth.c Outdated

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.c Outdated
Comment thread apps/wolfsshd/auth.c Outdated

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 3
3 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.c Outdated
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread apps/wolfsshd/auth.c Outdated

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

No new issues found in the changed files. ✅

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 3
3 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/test/test_configuration.c Outdated
Comment thread apps/wolfsshd/test/test_configuration.c Outdated
Comment thread apps/wolfsshd/auth.c Outdated
Comment thread apps/wolfsshd/auth.c Outdated
Comment thread apps/wolfsshd/test/test_configuration.c Outdated
Comment thread apps/wolfsshd/test/test_configuration.c Outdated

@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 #1116

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread apps/wolfsshd/auth.c
@ejohnstown ejohnstown changed the title Mitigate timing oracle using dummy hash cache Equalize crypt() cost when password auth is rejected early Aug 5, 2026
@ejohnstown
ejohnstown merged commit 492e8cd into wolfSSL:master Aug 5, 2026
154 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