{
  "id": "security/ruby/cedarcode__webauthn-ruby/2026-10-11-substring-origin-match",
  "title": "Substring origin match when `allowed_origins` or `allowed_top_origins` is a `String`",
  "category": "security",
  "type": "incorrect-comparison",
  "severity": "medium",
  "cvss": {
    "vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N",
    "score": 4.2
  },
  "ecosystem": "ruby",
  "project": {
    "owner": "cedarcode",
    "repo": "webauthn-ruby",
    "url": "https://github.com/cedarcode/webauthn-ruby"
  },
  "affected_versions": [
    "webauthn >= 3.5.0, < 3.5.2",
    "webauthn >= 3.4.0, < 3.4.5"
  ],
  "fixed_version": "3.5.2 and 3.4.5",
  "status": "published",
  "disclosure": {
    "channel": "email",
    "ghsa_id": "GHSA-97v8-p42x-qfhv",
    "cve_id": null,
    "url": "https://github.com/cedarcode/webauthn-ruby/security/advisories/GHSA-97v8-p42x-qfhv",
    "reported_at": "2026-10-11T00:00:00+03:00",
    "published_at": "2026-12-02T00:24:45+03:00"
  },
  "summary": "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.",
  "discovered_at": "2026-10-11T00:00:00+03:00",
  "public": true,
  "credit": "ucsurf",
  "updated_at": "2026-12-02T00:35:00+03:00",
  "pr": null,
  "references": [
    "https://github.com/cedarcode/webauthn-ruby/commit/b7123e3eb685b0edbb24d0d002ac85378098fdaa",
    "https://github.com/cedarcode/webauthn-ruby/commit/9eefe851db652dad6b07b7ff2bca93ac97cdc8e8",
    "https://github.com/cedarcode/webauthn-ruby/releases/tag/v3.5.2",
    "https://github.com/cedarcode/webauthn-ruby/releases/tag/v3.4.5"
  ]
}
