RubySec

Providing security resources for the Ruby community

GHSA-g35w-vq7x-8qcv (webauthn): webauthn allows unauthenticated input to reach Regexp.new through an unsafe cbor decoder default

webauthn allows unauthenticated input to reach Regexp.new through an unsafe cbor decoder default

Published: December 01, 2026

SECURITY IDENTIFIERS

GEM

webauthn

SEVERITY

CVSS v3.x: 8.1 (High)

PATCHED VERSIONS

~> 2.5.3 ~> 3.3.1 ~> 3.4.4 >= 3.5.1

DESCRIPTION

Summary

webauthn decodes CBOR data sent by the client with the cbor gem. Versions of cbor before 0.6.2.2 build a Regexp object from CBOR tag 35 by default while decoding, which passes the tagged string to Regexp.new. That default is unsafe for data from an untrusted source.

The WebAuthn specification defines parts of the registration and authentication responses as CBOR: the registration response holds a CBOR-encoded attestation object, and the authenticator data in both ceremonies can hold CBOR-encoded extensions. webauthn decodes all of this data before it finishes verifying the response. All versions of webauthn before the fixed releases require cbor ~> 0.5.9. As a result, an unauthenticated user can pass an arbitrary string to Regexp.new, and applications cannot install a cbor version with the safe default.

Details

webauthn calls the cbor decoder on client-supplied data in two ceremonies:

  • Registration. The attestation object is a CBOR map, and the authenticator data inside it holds a CBOR-encoded public key and optional CBOR-encoded extensions. All of it must be decoded to verify the response.
  • Authentication. The authenticator data may hold CBOR-encoded extensions. WebAuthn::AuthenticatorData#valid? decodes them, and it runs before the assertion signature is verified.

A CBOR tag 35 item placed anywhere in that data makes cbor (before 0.6.2.2) call Regexp.new with the tagged string.

cbor 0.6.2.2 no longer builds Regexp or URI objects from CBOR tags by default. They decode to CBOR::Tagged values instead. The fixed versions of webauthn require cbor >= 0.6.2.2. They also require cose >= 1.4.0, because earlier cose versions require cbor ~> 0.5.9.

Impact

An unauthenticated attacker can make the server compile an arbitrary regular expression by sending a crafted WebAuthn registration or authentication response.

On Ruby versions affected by regular expression compiler vulnerabilities (such as GHSA-3p8q-wmhx-vm2w or GHSA-7x2q-68qv-6p8x), this can allow remote code execution before authentication.

Every application that passes client-supplied data to WebAuthn::Credential.from_create or WebAuthn::Credential.from_get and then calls verify is affected. That is the normal use of the gem.

Workarounds

There is no workaround. Earlier versions of webauthn cannot be used with a fixed cbor. Upgrade to webauthn 3.5.1, 3.4.4, 3.3.1 or 2.5.3.

Versions 1.x are no longer supported and will not receive a fix.

RELATED