Skip to main content

CVE-2026-34157 — Vulnerability in github.com/wailsapp/wails/v2

HIGH

Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins

Published October 27, 2026Updated November 5, 2026Source: OSV

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.

Check my go.sum

Summary

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

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
Update github.com/wailsapp/wails/v2 to 2.13.0 or later
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).

PackageFixed In
github.com/wailsapp/wails/v2 Go · Affected: All versions2.13.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.2 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
P
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

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

CVSS Score
9.2

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.53%
EPSS percentile: 38.1

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

GHSA-47hv-j4px-h3c9
GO-2026-6862

Related CVEs

  • CVE-2026-108262
    HIGH

    DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885

  • CVE-2026-130007
    HIGH

    k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum