Skip to content

fix(webauthn): offer RS256 for the PRF-wrapping credential - #142

Merged
stormer78 merged 1 commit into
mainfrom
fix/webauthn-rs256-pubkeycredparam
Aug 30, 2026
Merged

fix(webauthn): offer RS256 for the PRF-wrapping credential#142
stormer78 merged 1 commit into
mainfrom
fix/webauthn-rs256-pubkeycredparam

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

What

Adds RS256 (alg: -257) to pubKeyCredParams for the WebAuthn credential that carries the PRF extension, last in the preference list after EdDSA and ES256.

Why

Chromium warns when pubKeyCredParams offers neither ES256 nor RS256:

publicKey.pubKeyCredParams is missing at least one of the default algorithm identifiers: ES256 and RS256. This can result in registration failures on incompatible authenticators.

It surfaces in chrome://extensions as an error against the extension, where it sits next to real faults. A user hit exactly that while diagnosing an unrelated mediator connectivity problem, and it cost time to rule out.

The credential enrolled in enrollOrLoadCredential exists only to carry the PRF extension — the wallet consumes prf.results.first and never verifies a signature from it, and the PRF output is independent of the key's algorithm. Admitting RSA therefore costs nothing and widens the set of authenticators that can hold the wallet's wrapping secret.

What this deliberately does not touch

enrollPasskey in packages/core/src/webauthn/register.ts keeps ES256/EdDSA only. That key is registered as a DID verification method, and importSpkiForAlg accepts only ES256/EdDSA/ES384 — an RSA credential there would enroll successfully and then fail to import. The comment records this at the point someone would be tempted to copy the change across.

Pre-merge checklist

  • npm run lint clean
  • npm run build clean
  • npm test — all suites pass
  • MV3 invariants: dist/background.js single bundle, no dynamic import(), no chrome.cookies, no static content_scripts
  • No behaviour change to any signature-verifying path

Chromium warns when `pubKeyCredParams` offers neither ES256 nor RS256,
and surfaces the warning in chrome://extensions as an error against the
extension — where it sits beside real faults and costs a reader the time
to rule it out. One did exactly that while diagnosing an unrelated
mediator problem.

The credential enrolled here exists only to carry the PRF extension: the
wallet consumes `prf.results.first` and never verifies a signature from
it, and the PRF output does not depend on the key's algorithm. So
admitting RSA costs nothing and widens the set of authenticators that
can hold the wrapping secret.

Deliberately not applied to `enrollPasskey` in core, whose key IS
registered as a DID verification method: `importSpkiForAlg` accepts only
ES256/EdDSA/ES384, so an RSA credential there would enroll and then fail
to import. The comment says so at the point someone would copy it.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 5da8843 into main Aug 30, 2026
3 checks passed
@stormer78
stormer78 deleted the fix/webauthn-rs256-pubkeycredparam branch August 30, 2026 08:31
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