CVE-2026-34157 — Vulnerability in github.com/wailsapp/wails/v2
Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.53%). Schedule for your next planned update.
Does your project use an affected github.com/wailsapp/wails/v2 version?
Paste your go.sum to check it for CVE-2026-34157 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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 |
Advisory Timeline
- First published October 27, 2026 (30 days ago).
- Last revised November 5, 2026 — 9 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get github.com/wailsapp/wails/v2@v2.13.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Go (1).
| Package | Fixed In |
|---|---|
| github.com/wailsapp/wails/v2 Go · Affected: All versions | 2.13.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-625
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.2 score means for each attack dimension.
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
References
Frequently Asked Questions
- What is CVE-2026-34157?
- Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 9.2/10).
- How do I check if my project is affected by CVE-2026-34157?
- CVE-2026-34157 affects github.com/wailsapp/wails/v2. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-34157 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is a below-median EPSS score — only 38.1% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-108262HIGH
DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885
- CVE-2026-130007HIGH
k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution