Skip to content

fix(auth): set WebAuthn user verification per request - #38810

Merged
silverwind merged 4 commits into
go-gitea:release/v1.27from
silverwind:backport-38805-v1.27
Aug 8, 2026
Merged

silverwind merged 4 commits into
go-gitea:release/v1.27from
silverwind:backport-38805-v1.27

Conversation

@silverwind

Copy link
Copy Markdown
Member

Backport #38805

Registration omitted userVerification, so Chromium raised the credential to credProtect level 3 and the authenticator then hid it from the second-factor login, which asked for discouraged. Registration and each login now set their own value, with preferred on the second factor so credentials already registered at level 3 keep working without re-enrollment.

Also add relevant e2e test coverage for webauthn, one test is chromium only because Firefox lacks the APIs needed.

Fixes #33531
Fixes #36019
Fixes #38139

Registration omitted userVerification, so Chromium raised the discoverable
credential to credProtect level 3 and the authenticator then hid it from the
second-factor login. Both logins asked for "discouraged", which also lets a
client skip verification entirely and makes "alwaysUv" authenticators refuse.

Each ceremony now states its own value: "required" to register and for the
passkey login, which is single factor, and "preferred" for the second factor,
which repairs credentials that were already registered at level 3.

Assisted-by: Claude Code:claude-opus-5
Every path that parks a pending sign-in carried its own copy of the session
update and the webauthn/two_factor redirect, so they had drifted apart. Route
them all through one helper and let each path state whether a factor is still
owed, and attach a pending identity only once the factor answered.

Follow-up to db9f64e, addressing review feedback.

Assisted-by: Claude Code:claude-opus-5
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 6, 2026
@GiteaBot GiteaBot added this to the 1.27.2 milestone Aug 6, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 7, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 8, 2026
@silverwind
silverwind enabled auto-merge (squash) August 8, 2026 09:46
@silverwind
silverwind merged commit 9204464 into go-gitea:release/v1.27 Aug 8, 2026
23 checks passed
@silverwind
silverwind deleted the backport-38805-v1.27 branch August 8, 2026 10:11
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

⌂