Improper Input Validation Affecting tauri-plugin-shell package, versions <2.2.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.53% (66th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Input Validation vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUST-TAURIPLUGINSHELL-9697751
  • published15 Apr 2025
  • disclosed2 Apr 2025
  • creditRigidity

Introduced: 2 Apr 2025

NewCVE-2025-31477  (opens in a new tab)
CWE-20  (opens in a new tab)

How to fix?

Upgrade tauri-plugin-shell to version 2.2.1 or higher.

Overview

tauri-plugin-shell is a plugin that allows you to spawn child processes and manage files and URLs using their default application.

Affected versions of this package are vulnerable to Improper Input Validation of allowed protocols in the open endpoint. An attacker can execute arbitrary code on the system by passing untrusted input that specifies dangerous protocols such as file://, smb://, or nfs://.

Note:

This is only exploitable if the open endpoint is directly exposed to application users or if code execution occurs in the frontend of a Tauri application.

Workaround

This vulnerability can be mitigated by setting the shell plugin configuration value open to true, which restricts the allowed protocols to mailto, http and https. Alternatively, defining a non-matching regex or removing shell:default and all instances of shell:allow-open from the capabilities can prevent the use of the open endpoint.

PoC

This is a windows specific proof of concept.

  1. Use create-tauri-app to make a new Tauri app;

  2. Run tauri add shell to add the shell plugin;

  3. Execute await window.__TAURI_INTERNALS__.invoke("plugin:shell|open", {path: "file:///c:/windows/system32/calc.exe"}); in the developer console;

  4. Observe the calculator being executed.

References

CVSS Base Scores

version 4.0
version 3.1