RubySeverity: MediumStatus: Published
Substring origin match when `allowed_origins` or `allowed_top_origins` is a `String`
When allowed_origins or allowed_top_origins is a String instead of an Array, include? does a substring match, so a prefix origin such as https://login.example.co can pass for https://login.example.com (CWE-697). Only applications that pass a String are affected. In 3.4.x only allowed_origins is affected. A lookalike origin still cannot make a browser mint credentials for the real RP ID. For allowed_top_origins, and only when verify_cross_origin is enabled, a lookalike page could iframe the relying party and pass the top-origin check if the relying party allows framing. Patched in 3.5.2 and 3.4.5. There is no CVE. Reported by ucsurf (credited as reporter in the advisory). Fixed by Santiago Rodriguez (@santiagorodriguez96) in v3.5.2 and v3.4.5.
Impact
When an application sets allowed_origins or allowed_top_origins to a String instead of an Array, origin verification uses include?. On a String, that is a substring match, so a prefix origin such as https://login.example.co can pass for https://login.example.com (CWE-697).
Only applications that pass a String are affected, through the global configuration or WebAuthn::RelyingParty.new. In 3.4.x only allowed_origins is affected, because allowed_top_origins was added in 3.5.0.
A lookalike origin still cannot make a browser mint credentials for the real RP ID. For allowed_top_origins, and only when verify_cross_origin is enabled, a lookalike page could iframe the relying party and pass the top-origin check if the relying party allows framing.
Affected versions and fix
The webauthn gem is affected in versions >= 3.5.0, < 3.5.2, and in versions >= 3.4.0, < 3.4.5. Patched releases are 3.5.2 and 3.4.5.
Santiago Rodriguez (@santiagorodriguez96) fixed the 3.5 line in b7123e3, released as v3.5.2. The 3.4 line is fixed in 9eefe85, released as v3.4.5.
The published advisory is GHSA-97v8-p42x-qfhv. GitHub rates it medium, with CVSS 3.1 score 4.2 (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N). There is no CVE. The maintainer published the advisory on 2026-12-02. It was reported by email on 2026-10-11. Reported by ucsurf (credited as reporter in the advisory). Fixed by Santiago Rodriguez (@santiagorodriguez96) in v3.5.2 and v3.4.5.
Timeline
- Found
- Reported via email
- Advisory published
- Entry last updated
Machine-readable: JSON · Markdown · ID security/ruby/cedarcode__webauthn-ruby/2026-10-11-substring-origin-match
If this work is useful to you, you can support it on Buy Me a Coffee.