
Go proof-of-concept reproducing CVE-2026-34157, a Wails v2 origin validator wildcard bypass (CWE-625), comparing vulnerable v2.12.0 against fixed v2.13.0.
This repository contains a safe local proof of concept for CVE-2026-34157, based on the Wails public advisory GHSA-47hv-j4px-h3c9.
Wails v2 uses BindingsAllowedOrigins to restrict which web origins may invoke
Go backend bindings. Before the fix, every * in an allowed-origin pattern was
converted to the regular expression .*. If a developer used
https://myapp.com* intending to allow that domain and a port or related URL,
the validator also allowed attacker origins such as https://myapp.community
and https://myapp.com.attacker.com.
This PoC runs the real Wails OriginValidator from v2.12.0 and v2.13.0 in
temporary copies and compares their authorization decisions for the same
allowed pattern and attacker origins. It does not use the network, launch a
GUI, access files, or invoke a Go binding.
Discovered by: Saku0512
This project is intended only for education and explicitly authorized security testing. Do not use it against systems or environments without permission.
github.com/wailsapp/wails/v2CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L/SC:L/SI:L/SA:N)>= 2.0.0, < 2.13.02.13.0BindingsAllowedOrigins.https://myapp.com*.The documented complete-component subdomain pattern https://*.myapp.com is
not affected by this issue.
The vulnerable wildcardPatternToRegex escaped regex metacharacters and then
unconditionally replaced every * with .*:
escaped = strings.ReplaceAll(escaped, "*", ".*")
return "^" + escaped + "$"
The configuration:
https://myapp.com*
therefore became:
^https://myapp\.com.*$
Because the expression does not respect origin-component boundaries, it allows all of these attacker origins:
https://myapp.community
https://myapp.com.attacker.com
https://myapp.comXXXXX
The patched implementation expands * to [^.:/@]+ only when it represents a
complete component bounded by separators such as ://, ., or :. A partial
label such as myapp.com* is treated literally and fails closed.
./scripts/run-version-matrix.sh
Expected key output:
Wails v2.12.0
[!] VULNERABLE: trailing wildcard allowed all crafted attacker origins.
Wails v2.13.0
[+] FIXED: trailing wildcard rejected all crafted attacker origins.
Vulnerable version:
./scripts/run-poc.sh v2.12.0 vulnerable
Patched version:
./scripts/run-poc.sh v2.13.0 fixed
run-poc.sh:
poc_test.go to the real internal/frontend/originvalidator package.IsOriginAllowed through go test.It does not modify the module cache or an existing Wails source tree.
The PoC verifies that:
https://*.myapp.com permits only a legitimate one-label subdomain.https://myapp.com* is tested against three attacker origins.This PoC directly exercises the real Origin Validator authorization boundary identified by the advisory. It does not load an external page in a WebView or invoke bindings in a complete Wails desktop application. Post-bypass impact depends on which bindings the affected application exposes.
Upgrade to Wails v2.13.0 or later. If an immediate upgrade is not possible, do
not use trailing or partial-label wildcards; enumerate allowed origins exactly.
When using https://*.myapp.com, ensure that only trusted subdomains exist.