CVE-2026-34157: Go/github.com/wailsapp/wails/v2 vulnerability

Published Oct 27, 2026
·
Updated

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

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

| 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 |

Affected Software

1 affected componentFixes available
go/github.com/wailsapp/wails/v2>=2.0.0<2.13.0
2.13.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/wailsapp/wails/v2 to a version that resolves this vulnerability.

    Fixed in 2.13.0
  2. Configuration

    Replace trailing partial-label wildcard patterns such as `myapp.com*` with a wildcard representing a full domain component, such as `https://*.myapp.com`; do not use wildcards appended directly to a domain label.

    Wails v2 BindingsAllowedOrigins = https://*.myapp.com

Event History

Oct 27, 2026
Advisory Published
via GitHub·01:29 PM
Data Sourced
via GitHub·01:29 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which applications are exposed to this issue?

Wails v2 applications are exposed when they use BindingsAllowedOrigins with wildcard patterns that can be suffix-matched. The issue applies to all desktop targets listed: Windows, Linux, and macOS.

2

What does an attacker need to exploit the bypass?

An attacker needs to control a web origin whose domain shares a prefix with an allowed wildcard origin, such as myapp.community when myapp.com* is allowed. The CVSS vector indicates network reachability, no privileges, and required user interaction.

3

How can I determine whether my application is affected?

Review BindingsAllowedOrigins configuration for wildcard entries, particularly patterns that append * to an origin or domain prefix. Applications using versions containing originValidator are affected when such a pattern can match an attacker-controlled suffix.

4

What is the likely impact if exploitation succeeds?

An attacker may invoke arbitrary Go backend methods exposed through the application's IPC bindings. The resulting impact depends on the exposed API surface and can include file system access, data exfiltration, or code execution.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203