GHSA-47hv-j4px-h3c9 - Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
# 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) |
---
## Summary
Wails v2 provides `BindingsAllowedOrigins` to restrict which web origins can invoke Go backend methods via IPC. The wildcard pattern matching in `wildcardPatternToRegex` converts `*` to `.*` without anchoring subcomponents, allowing suffix-matched origins to bypass the restriction.
An attacker who controls a domain sharing a prefix with the allowed origin (e.g., `myapp.community` when `myapp.com*` is configured) can invoke arbitrary bound Go methods, potentially achieving file system access, data exfiltration, or code execution depending on the application's exposed API surface.
---
## 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`
```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 = stri
HIGH
Severity & confidence
Source severityhigh
Platform severityhigh
Confidencemedium
Exploitationunknown
CVSS-
Affected
Vendorsgithub
Productsgithub.com/wailsapp/wails/v2
Reporting sources (1)
GitHub Security Advisories
Timeline & provenance
Published2026-10-27T13:29:47
Last updated2026-10-28T19:42:00
Ingested2026-10-27T13:40:37
FreshnessNEAR-REAL-TIME
Threat typeadvisory
Recommended action
Review the advisory and upgrade affected packages to the first patched version.
Next steps
- Identify affected systems in your environment.
- Apply the vendor patch or mitigation guidance.
- Review logs for indicators described in the advisory.
- Follow the affected vendor/product to track updates.
Confidence explanation
Reported by a single or secondary source; treat as indicative, verify before acting.
Source type: vendor ยท Original: GitHub Security Advisories