Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹 Go
Not in CISA KEV

CVE-2026-34157 — wails

Fix: wailsapp/wails#5074

CVE-2026-34157 is a remote code execution vulnerability in github.com/wailsapp/wails/v2. A fix is available for github.com/wailsapp/wails/v2 — see the affected versions and patch details below.

Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins

Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 27, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
🐹github.com/wailsapp/wails/v2

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Security Vulnerability Report: Wails v2 — Origin Validator Bypass via Wildcard Pattern

Productwailsapp/wails (v2)
Affected Filev2/internal/frontend/originvalidator/originValidator.go
Affected VersionsAll versions containing originValidator (latest as of 2026-03-26)
CVSSv4.07.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
CWECWE-625: Permissive Regular Expression
PlatformsWindows / 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 TLD
  • https://myapp.com.attacker.com — attacker-controlled subdomain
  • https://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

DateEvent
2026-03-26Vulnerability discovered during source code audit by @Saku0512
2026-03-26Private report submitted via GitHub Security Advisory
2026-03-26Vendor acknowledgement and fix PR opened (#5074)
TBDPatch release
TBD + 90 daysPublic disclosure deadline

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/wailsapp/wails/v2≥ 2.0.0&&< 2.13.02.13.0go get github.com/wailsapp/wails/v2@v2.13.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/wailsapp/wails/v2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update github.com/wailsapp/wails/v2 to 2.13.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-34157 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

# 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`
O3 Security · Impact-Aware SCA

Is CVE-2026-34157 in your dependencies?

Find it across Go, including transitive dependencies.