GHSA-47hv-j4px-h3c9: 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 `https://myapp.com*` with a full domain-component wildcard such as `https://*.myapp.com`; do not use a wildcard 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 affected in practice?

Wails v2 applications on Windows, Linux, or macOS are affected if they contain originValidator and use BindingsAllowedOrigins with a wildcard pattern whose matching can be bypassed. The report identifies all versions containing originValidator as affected.

2

What does an attacker need to exploit this issue?

The attacker needs to control an 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, low attack complexity, and required user interaction.

3

How can I identify risky origin allowlist entries?

Review BindingsAllowedOrigins settings for wildcard patterns, especially patterns that append * to an origin or domain prefix. These patterns may match attacker-controlled suffixes because * is converted to .* without anchoring subcomponents.

4

What determines the impact if the origin check is bypassed?

Impact depends on the Go methods the application exposes through IPC. A successful bypass can let the untrusted origin invoke arbitrary bound Go methods, potentially enabling 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