CVE-2026-34157
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
Wails is a framework for building desktop applications using Go and web technologies. From 2.0.0 until 2.13.0, BindingsAllowedOrigins in v2/internal/frontend/originvalidator/originValidator.go passes wildcard patterns to wildcardPatternToRegex, which expands every asterisk to an unrestricted regular-expression match. When an application configures a trailing or partial-label wildcard immediately after an allowed domain, an attacker-controlled lookalike origin can match the allowed suffix and invoke bound Go methods through IPC. A complete-component subdomain wildcard is an unaffected configuration. The resulting confidentiality, integrity, and availability impact depends on the file, database, command, credential, or other operations exposed by the application's bound methods. This issue is fixed in version 2.13.0.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
7.6
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
Wails is a framework for building desktop applications using Go and web technologies. From 2.0.0 until 2.13.0, BindingsAllowedOrigins in v2/internal/frontend/originvalidator/originValidator.go passes wildcard patterns to wildcardPatternToRegex, which expands every asterisk to an unrestricted regular-expression match. When an application configures a trailing or partial-label wildcard immediately after an allowed domain, an attacker-controlled lookalike origin can match the allowed suffix and invoke bound Go methods through IPC. A complete-component subdomain wildcard is an unaffected configuration. The resulting confidentiality, integrity, and availability impact depends on the file, database, command, credential, or other operations exposed by the application's bound methods. This issue is fixed in version 2.13.0.
- Record
CVE-2026-34157- CVSS 4.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 - Weakness
- CWE-625
- Updated
- 2026-11-05
EUVDEUVD-2026-117787
7.6
Wails is a framework for building desktop applications using Go and web technologies. From 2.0.0 until 2.13.0, BindingsAllowedOrigins in v2/internal/frontend/originvalidator/originValidator.go passes wildcard patterns to wildcardPatternToRegex, which expands every asterisk to an unrestricted regular-expression match. When an application configures a trailing or partial-label wildcard immediately after an allowed domain, an attacker-controlled lookalike origin can match the allowed suffix and invoke bound Go methods through IPC. A complete-component subdomain wildcard is an unaffected configuration. The resulting confidentiality, integrity, and availability impact depends on the file, database, command, credential, or other operations exposed by the application's bound methods. This issue is fixed in version 2.13.0.
- Record
EUVD-2026-117787- CVSS 4.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 - Updated
- 2026-11-05
GitHub AdvisoriesGHSA-47hv-j4px-h3c9
7.6
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
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 TLDhttps://myapp.com.attacker.com— attacker-controlled subdomainhttps://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.
Impact
Any Go method registered with Wails bindings becomes callable from the attacker's origin. Depending on the application:
- File system read / write (common in desktop apps)
- Database queries
- OS command execution (if exposed via bindings)
- Sensitive configuration or credential access
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.
Disclosure Timeline
| Date | Event | |---|---| | 2026-03-26 | Vulnerability discovered during source code audit by @Saku0512 | | 2026-03-26 | Private report submitted via GitHub Security Advisory | | 2026-03-26 | Vendor acknowledgement and fix PR opened (#5074) | | TBD | Patch release | | TBD + 90 days | Public disclosure deadline |
- Record
GHSA-47hv-j4px-h3c9- CVSS 4.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 - Weakness
- CWE-625
- Updated
- 2026-11-02
NVD
7.6
Wails is a framework for building desktop applications using Go and web technologies. From 2.0.0 until 2.13.0, BindingsAllowedOrigins in v2/internal/frontend/originvalidator/originValidator.go passes wildcard patterns to wildcardPatternToRegex, which expands every asterisk to an unrestricted regular-expression match. When an application configures a trailing or partial-label wildcard immediately after an allowed domain, an attacker-controlled lookalike origin can match the allowed suffix and invoke bound Go methods through IPC. A complete-component subdomain wildcard is an unaffected configuration. The resulting confidentiality, integrity, and availability impact depends on the file, database, command, credential, or other operations exposed by the application's bound methods. This issue is fixed in version 2.13.0.
- Record
CVE-2026-34157- CVSS 4.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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-625
- Updated
- 2026-11-05
OSV
7.6
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
Wails is a framework for building desktop applications using Go and web technologies. From 2.0.0 until 2.13.0, BindingsAllowedOrigins in v2/internal/frontend/originvalidator/originValidator.go passes wildcard patterns to wildcardPatternToRegex, which expands every asterisk to an unrestricted regular-expression match. When an application configures a trailing or partial-label wildcard immediately after an allowed domain, an attacker-controlled lookalike origin can match the allowed suffix and invoke bound Go methods through IPC. A complete-component subdomain wildcard is an unaffected configuration. The resulting confidentiality, integrity, and availability impact depends on the file, database, command, credential, or other operations exposed by the application's bound methods. This issue is fixed in version 2.13.0.
- Record
CVE-2026-34157- CVSS 4.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 - Weakness
- CWE-625
- Updated
- 2026-11-07
OSVGHSA-47hv-j4px-h3c9
7.6
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
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 TLDhttps://myapp.com.attacker.com— attacker-controlled subdomainhttps://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.
Impact
Any Go method registered with Wails bindings becomes callable from the attacker's origin. Depending on the application:
- File system read / write (common in desktop apps)
- Database queries
- OS command execution (if exposed via bindings)
- Sensitive configuration or credential access
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.
Disclosure Timeline
| Date | Event | |---|---| | 2026-03-26 | Vulnerability discovered during source code audit by @Saku0512 | | 2026-03-26 | Private report submitted via GitHub Security Advisory | | 2026-03-26 | Vendor acknowledgement and fix PR opened (#5074) | | TBD | Patch release | | TBD + 90 days | Public disclosure deadline |
- Record
GHSA-47hv-j4px-h3c9- CVSS 4.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 - Weakness
- CWE-625
- Updated
- 2026-11-06
OSVGO-2026-6862 No score
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins in github.com/wailsapp/wails
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins in github.com/wailsapp/wails
- Record
GO-2026-6862- Updated
- 2026-11-06
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/wailsapp/wails/v2Go |
2.0.0 up to 2.13.0 | 2.13.0 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | Saku0512/CVE-2026-34157-poc | 2026-10-18 |
History
| Recorded | Changed | Sources |
|---|---|---|
| references | OSV | |
| affected, aliases, references | NVD, OSV | |
| aliases | EUVD | |
| description, facts, products, references, severity | CVE List | |
| first indexed | GitHub Advisories, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-34157 is a high vulnerability (CVSS 7.6) in Wailsapp Wails, published October 27, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.50%, the 42nd percentile. Fixed in github.com/wailsapp/wails/v2 2.13.0.
References
github.com/wailsapp/wails/security/advisories/GHSA-47hv-j4px-h3c9
github.com/wailsapp/wails/pull/5074
github.com/wailsapp/wails/commit/bcc5941b72fdab6a13942b58871a2696faa85b81
github.com/wailsapp/wails/releases/tag/v2.13.0
github.com/advisories/GHSA-47hv-j4px-h3c9
github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34157.json
nvd.nist.gov/vuln/detail/CVE-2026-34157
github.com/wailsapp/wails