Wails: wildcardPatternToRegex allows Origin bypass via suffix match in BindingsAllowedOrigins
CVSS score
—
EPSS probability
—
Risk score
—
Published
2 h ago
Resmî kaynaklarda yeterli kanıt bulunamadı. Bu sonuç “yama yok” anlamına gelmez.
Impact on My Inventory
Only the personal products you have added to your account are assessed; an organisation's inventory does not appear here.
Checking session…
Vulnerability description
DayBreach AI Explanation
Verified against sourcesSources read
1
Source agreement
Tam uyum
Evidence confidence
%55
Short explanation
A wildcard pattern matching flaw in Wails v2 BindingsAllowedOrigins allows origin restrictions to be bypassed via suffix matching. This enables attackers to invoke unauthorized Go backend methods via IPC.
The vulnerability allows attackers to bypass origin checks via a shared prefix, creating risks such as file system access or data exfiltration depending on the application interface.
What should be done?
- Follow vendor security advisories to apply updates
- Review BindingsAllowedOrigins configurations for vulnerable suffix matching
- Adhere to vendor guidance since the patch status is currently unknown
Chain of evidence and sources
Wails v2 içinde wildcardPatternToRegex fonksiyonu * karakterini .* olarak dönüştürür.
Yama durumu resmi kaynaklarda henüz doğrulanamamıştır.
Show the technical text from the sources
# 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 |
CWE: CWE-625
This explanation was compiled automatically from the source records. Scores, active exploitation, patch and exploit status come straight from the sources.
IMPACT: Affected Products and Software
Affected Products
The following products are affected by CVE-2026-34157 vulnerability. Where our threat engine knows the exact affected versions, they are listed below.
| ID | VENDOR | PRODUCT | ACTION |
|---|---|---|---|
| 1 | go | github.com/wailsapp/wails/v2 | View |
RED HAT CSAF/VEX: Product Impact Check
SCORING: CVSS from Multiple Sources
CVSS Scores
The Common Vulnerability Scoring System is a standardised framework for assessing the severity of vulnerabilities in software and systems. We collect and display CVSS scores from several sources for each CVE.
| SCORE | VERSION | SEVERITY | VECTOR | SOURCE |
|---|---|---|---|---|
| 7.6 | CVSS 4.0 | — | Vector not published | GitHub Advisory |
Patch and Remediation Guide
Solution & Remediation Advisory
İncelenen resmî kaynaklarda yama durumu doğrulanamadı. Bu sonuç “yama yok” anlamına gelmez.
Public exploit and active exploitation status
Verified exploit intelligence
No verified public PoC, exploit repository or Metasploit module has been found for this CVE yet.
Weakness Classification and Attack Patterns (CWE & CAPEC)
CWE - Common Weakness Enumeration
While CVE identifies specific instances of vulnerabilities, CWE categorises the common flaws or weaknesses that can lead to vulnerabilities. CVE-2026-34157 is associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2026-34157 weaknesses.
Official Sources and Advisories
Similar Vulnerabilities
Get this vulnerability through the API
Affected products, version ranges, exploitation status and patch information in a single request, with a free key.
curl -H "x-api-key: $DAYBREACH_API_KEY" \ "https://api.daybreach.dev/api/v1/intel/cves/CVE-2026-34157"