Live › vulnerability › CVE-2026-34157
Go to dashboardWails v2 converts a trailing wildcard in BindingsAllowedOrigins into an unanchored regex, so an origin such as myapp.com.attacker.com or myapp.community passes the check. A page on such an origin can call any Go method bound to the app, which may expose file access, data or commands.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-10-27 13:31 UTC. All times on this page are UTC.
Apps built with Wails v2 that set BindingsAllowedOrigins and use a trailing wildcard on a domain are exposed, because the wildcard matches any suffix after the domain. Apps that do not set BindingsAllowedOrigins, use exact origins, or only use the documented subdomain-prefix pattern are not affected according to the advisory's scope note. Desktop targets on Windows, Linux and macOS are all listed.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| github.com/wailsapp/wails/v2 | go | >= 2.0.0, < 2.13.0 | 2.13.0 |
BindingsAllowedOrigins and look for patterns ending in * without a dot-prefixed subdomain, such as https://myapp.com*.go list -m github.com/wailsapp/wails/v2; versions from 2.0.0 up to but not including 2.13.0 are affected.github.com/wailsapp/wails/v2 to 2.13.0 or later (fix PR #5074).myapp.com* with exact origins or https://*.myapp.com style subdomain patterns.Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
| 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) |
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.
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.
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 suffixThe 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.
Any Go method registered with Wails bindings becomes callable from the attacker's origin. Depending on the application:
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.
| 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 |
This page as .md · .json · in your agent: get_signal("CVE-2026-34157")
GitHub Advisory Database, CC-BY 4.0. Posts quoted belong to their authors.