Vulnerability GHSA-47hv-j4px-h3c9

High Risk
HIGH RISK
CVSS Score: 8.0
Score Range: 7.0–8.9
High severity vulnerabilities (CVSS 7.0–8.9). Serious vulnerabilities that should be prioritized soon after critical fixes.
9 days ago
October 27, 2026 at 01:29 PM UTC
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
>=2.0.0 <2.13.0
>=2.0.0 <2.13.0

Summary

Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins

Details

Security Vulnerability Report: Wails v2 — Origin Validator Bypass via Wildcard Pattern

Product wailsapp/wails (v2)
Affected File v2/internal/frontend/originvalidator/originValidator.go
Affected Versions All versions containing originValidator (latest as of 2026-03-26)
CVSSv4.0 7.6 HIGH — CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L/SC:L/SI:L/SA:N
CWE CWE-625: Permissive Regular Expression
Platforms Windows / Linux / macOS (all desktop targets)

Vulnerability Details

Root Cause

wildcardPatternToRegex converts a wildcard pattern to a regular expression by escaping special characters and replacing * with .*. The substituted .* has no restriction — it matches any character sequence including dots and additional domain components.

Vulnerable Code

File: v2/internal/frontend/originvalidator/originValidator.go

func (v *OriginValidator) wildcardPatternToRegex(wildcardPattern string) string {
    specialChars := []string{"\\", ".", "+", "?", "^", "$", "{", "}", "(", ")", "|", "[", "]"}

    escaped := wildcardPattern
    for _, specialChar := range specialChars {
        escaped = strings.ReplaceAll(escaped, specialChar, "\\"+specialChar)
    }

    // * becomes .* — matches ANY character sequence, including dots and domain separators
    escaped = strings.ReplaceAll(escaped, "*", ".*")

    return "^" + escaped + "$"
}

The generated regex for https://myapp.com* is:

^https://myapp\.com.*$

This matches any string beginning with https://myapp.com, including:

  • https://myapp.community — different TLD
  • https://myapp.com.attacker.com — attacker-controlled subdomain
  • https://myapp.comXXXXX — any arbitrary suffix

Scope Note

The official comment in options.go gives https://*.myapp.com as the example pattern (subdomain prefix wildcard). This pattern is not affected. The vulnerability only manifests when developers use a trailing wildcard (myapp.com*), which is a natural misuse when intending to permit a domain and all its subpaths or ports.

Fix

PR: https://github.com/wailsapp/wails/pull/5074

Wildcards are now only expanded when they represent a full domain component (immediately after ://, ., or :). A wildcard appended to a partial label (e.g. com*) is stripped, preventing suffix-based bypasses. Comprehensive test suite added.

Timeline

Published
9 days ago
October 27, 2026 at 01:29 PM UTC
Fixed (v2.13.0)
4 months ago
July 06, 2026 at 10:44 AM UTC
Last Modified
8 hours ago
November 05, 2026 at 11:25 PM UTC