GitHub Advisoryadvisory · npm

GHSA-6hxq-p678-4hr2 SimpleWebAuthn: Registration verification does not sufficiently ensure that attestation certificates chain to a trust anchor

LOW Published 2026-09-04 Modified 2026-09-04 Official page ↗
Ecosystem
npm
Packages
@simplewebauthn/server
Severity
Low
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Weaknesses
CWE-295, CWE-296
Reviewed
2026-09-04

Affected packages

• npm @simplewebauthn/server: < 13.3.2 → fixed in 13.3.2

Description

Summary `validateCertificatePath()` does not verify that an attestation's certificate chain actually terminates at a configured trust anchor. When walking the chain it stops at the first self-signed certificate it finds (which could be user-supplied), and exits early. This happens before the configured Apple/Google/etc trust anchor (which is concatenated to the end of the chain) is reached. A user can therefore register a credential and have the server accept it as if it were backed by a genuine Apple / Android SafetyNet / Yubikey / etc. Details `packages/server/src/helpers/validateCertificatePath.ts`: The configured trust anchor is appended to the end of the untrusted chain (line 83): ```ts const x5cWithTrustAnchor = x5cCertsParsed.concat([anchor]); ``` The walk then verifies each cert was signed by the next, but breaks on the first self-signed cert (lines 104–116): ```ts if (issuer.subject === issuer.issuer) { // Root cert detected, make sure it signed itself const issuerSignedIssuer = await issuer.verify( { publicKey: issuer.publicKey, signatureOnly: true }, WebCrypto, ); if (!issuerSignedIssuer) { throw new InvalidSubjectAndIssuer(); } break; // ] walk: forgedLeaf -> attackerSelfSignedRoot (verifies, attacker controls both) attackerSelfSignedRoot is self-signed -> break attackerSelfSignedRoot -> configured root (NEVER CHECKED) ``` `return true`. The configured anchor never gets checked. As far as observed, all attestation enforcement uses validateCertificatePath when using MDS etc.

Related

Weakness · CWE (2)

  • CWE-295 Improper Certificate Validation weakness
  • CWE-296 Improper Following of a Certificate's Chain of Trust weakness

References