/

CVE-2026-42184

Severity:

HIGH RISK

(8.8)

SSRF in Tauri is_local_url()

CVE-2026-42184

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF) / Origin Validation Bypass

CWE:

CWE-918

Impact:

Server-Side Request Forgery and Origin Trust Bypass

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A logic flaw in Tauri's is_local_url() function on Windows and Android causes some remote URLs to be misclassified as trusted local origins.

By controlling a domain whose first subdomain matches an app's custom scheme, an attacker may be able to trick Tauri into treating attacker-controlled content as local, enabling server-side request forgery–style interactions and other trust-boundary bypasses.

Affected context

This vulnerability affects Tauri applications built with versions 2.0 through 2.11.0 running on Windows and Android that:

  • Use custom URI schemes which Tauri maps to http://<scheme>.localhost/
  • Rely on is_local_url() (or APIs that depend on it) to distinguish trusted local origins from remote content
  • Grant elevated capabilities, additional APIs, or relaxed security assumptions to "local" origins

The issue manifests when origin checks only inspect the first subdomain of a URL, allowing certain attacker-controlled domains to be treated as local.

Exploit preconditions

  • Attack surface: WebView-based Tauri apps on Windows and Android that:
  • Register custom URI schemes
  • Perform origin-based privilege decisions using is_local_url() or related mechanisms
  • Required access: Ability to lure a user into visiting attacker-controlled domains (e.g., via link, redirect, or embedded web content).
  • Trigger point: A navigation, request, or origin check where the application or framework invokes is_local_url() to verify whether the URL is local.
  • Why exploitation is possible: The origin validation logic considers only the first subdomain and the .localhost mapping, which can be mirrored by an attacker-controlled hostname whose leading subdomain matches the custom scheme, causing remote content to be misclassified as trusted local origin.

Why this happens

The root cause is a flawed origin validation routine that performs insufficient verification of hostnames when determining whether a URL is local.

On Windows and Android, Tauri maps custom protocol handlers to HTTP origins like http://<scheme>.localhost/ because the platform WebView cannot serve custom schemes directly. The is_local_url() function then attempts to recognize these local origins but only checks the first subdomain component.

This behavior aligns with CWE-918: Server-Side Request Forgery (SSRF) in the broader sense that untrusted, external endpoints are incorrectly treated as internal or trusted. The underlying bug is an origin trust boundary error: equating "shares a subdomain prefix" with "is the local loopback origin," which allows attacker-controlled domains to pass as local.

Potential impact

  • Attacker-controlled web pages may be treated as trusted "local" content by the Tauri app.
  • Remote content could gain access to privileged JavaScript APIs or capabilities intended only for local origins.
  • Potential abuse of higher-privileged operations exposed to "local" pages, such as file access, IPC channels, or OS integrations.
  • Bypass of origin-based access controls, leading to data exposure or modification within the application.
  • Expansion of the attack surface for chaining with other vulnerabilities (e.g., XSS in a "local" context becoming significantly more impactful).

General mitigation guidance

Mitigation should focus on hardening origin validation and minimizing trust based on hostnames alone:

  • Use strict origin comparisons that match full hostnames, schemes, and ports, rather than partial or subdomain-only checks.
  • Treat localhost-style mappings as trusted only when they resolve to loopback interfaces or are constructed internally, not when derived from or comparable to external hostnames.
  • Avoid granting broad, powerful privileges solely on the basis of an origin string; use additional trust signals such as signed bundles, explicit allowlists, or out-of-band configuration.
  • Design application APIs so that even "local" web content is constrained by least privilege, with granular, capability-based access rather than blanket local-origin trust.
  • Normalize and canonicalize URLs before comparison to reduce ambiguity and avoid edge cases in host parsing.

How teams detect issues like this

Detection efforts can concentrate on identifying overly permissive origin checks and hostname-based trust assumptions:

  • Use static analysis or code search to find functions that:
  • Perform partial hostname comparisons (e.g., checking only subdomains or suffixes) for security decisions.
  • Treat any domain pattern that "looks like" localhost as trusted without verifying its actual network location.
  • During code review, flag logic that:
  • Grants elevated permissions based on localhost or similar naming conventions.
  • Relies on URL string parsing instead of robust origin/URL APIs.
  • Incorporate security-focused linting or automated review tools to enforce policies like "no hostname substring matching for origin trust decisions."
  • Add runtime logging or telemetry around origin-based privilege grants to detect unexpected external origins being classified as "local."

Sources

SourceLink
github.comgithub.com/tauri-apps/tauri/security/advisories/GHSA-7gmj-67g7-phm9

Frequently asked

questions

Yes. An attacker who controls a suitably named remote domain and can induce a user to visit it from a vulnerable Tauri app may exploit the misclassification of the origin as local. There is no requirement for local access if the application loads or interacts with external URLs.

Not necessarily. If the app loads external content or follows links without prior authentication, an unauthenticated attacker can often trigger the issue by hosting a crafted page. In apps that gate all external navigation behind authentication, the attacker may first need to convince an authenticated user to access the malicious domain.

The most robust fix pattern is to perform exact, canonical origin matching for local trust decisions and eliminate partial hostname checks. Only explicitly constructed local loopback origins or tightly controlled allowlisted origins should receive elevated privileges, regardless of apparent similarity in hostnames.

Adopt a defense-in-depth approach to origin trust: avoid relying solely on hostnames, use well-tested URL/origin parsing APIs, keep local-origin privileges minimal and capability-based, and enforce security reviews for any feature that differentiates between "local" and "remote" origins. Continuous static analysis and code review policies that flag origin-based access control logic can also reduce recurrence.

Find out what's already
exploitable in your codebase.