Skip to content

fix: webauthn session data cred params#2759

Open
lfleischmann wants to merge 2 commits into
mainfrom
fix-webauthn-session-data-cred-params
Open

fix: webauthn session data cred params#2759
lfleischmann wants to merge 2 commits into
mainfrom
fix-webauthn-session-data-cred-params

Conversation

@lfleischmann

@lfleischmann lfleischmann commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

An earlier go-webauthn version added a mandatory algorithm-match check in CreateCredential, driven by SessionData.CredParams. Hanko round-trips WebAuthn session data through its own DB model instead of holding the
library struct in memory, and that mapping never carried CredParams, so every registration finish failed with "Credential public key algorithm not supported". Without this fix, we keep staying behind library updates.

Implementation

  • Persists CredParams via a new json column and round-trip it through NewWebauthnSessionDataFrom/ToSessionData.
  • Removes the orphaned dto/intern/WebauthnSessionData.go duplicate mapping, left over from the webauthn handler removal, which had the same gap and zero remaining callers.

Tests

Unit

  • Adds small unit test for session data conversion

Manual

With and without these changes:

  1. Start backend + frontend example
  2. Create passkeys/security keys (registration + profile flow) and login with them (login flow).

dependabot Bot and others added 2 commits July 20, 2026 15:23
Bumps [github.com/go-webauthn/webauthn](https://github.com/go-webauthn/webauthn) from 0.10.2 to 0.17.4.
- [Release notes](https://github.com/go-webauthn/webauthn/releases)
- [Changelog](https://github.com/go-webauthn/webauthn/blob/master/CHANGELOG.md)
- [Commits](go-webauthn/webauthn@v0.10.2...v0.17.4)

---
updated-dependencies:
- dependency-name: github.com/go-webauthn/webauthn
  dependency-version: 0.17.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
go-webauthn v0.17.4 added a mandatory algorithm-match check in
CreateCredential, driven by SessionData.CredParams. Hanko round-trips
WebAuthn session data through its own DB model instead of holding the
library struct in memory, and that mapping never carried CredParams,
so every registration finish failed with "Credential public key
algorithm not supported".

Persist CredParams via a new json column and round-trip it through
NewWebauthnSessionDataFrom/ToSessionData. Also removes the orphaned
dto/intern/WebauthnSessionData.go duplicate mapping, left over from
the pre-flowpilot webauthn handler removal, which had the same gap
and zero remaining callers.
@lfleischmann
lfleischmann marked this pull request as ready for review July 20, 2026 14:42
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.

1 participant