Skip to content

GHSA-q9wv-22m9-vhqh CVE-2022-41874 RUSTSEC-2022-0091

Tauri Filesystem Scope can be Partially Bypassed

Medium crates.io
Severity
2.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.46%
Chance of exploitation in the next 30 days. Higher than 40.24% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-284 Improper Access Control
Fix
Available
2 packages have a fixed version

Description

Impact

Due to incorrect escaping of special characters in paths selected via the file dialog and drag and drop functionality, it was possible to partially bypass the fs scope definition. It was not possible to traverse into arbitrary paths, as the issue was limited to neighboring files and sub folders of already allowed paths.

The impact differs on Windows, MacOS and Linux due to different specifications of valid path characters.

On Linux or MacOS based systems it was possible to use the *, ** and [a-Z] patterns inside a path, which allowed to read the content of sub directories and single character files in a folder, where only specific files or the directory itself were allowed.

On Windows [a-Z] was the possible bypass pattern, as * is not treated as a valid path component. This implies that only single character files inside an already allowed directory were unintentionally accessible.

This bypass depends on the file picker dialog or dragged files, as user selected paths are automatically added to the allow list at runtime.

A successful bypass requires the user to select a pre-existing malicious file or directory during the file picker dialog and an adversary controlled logic to access these files. This means the issue by itself can not be abused and requires further intentional or unintentional privileges.

Workaround

Disable the dialog and fileDropEnabled component inside the tauri.conf.json.

Patches

The issue has been resolved in #5237 and the implementation now properly escapes the special characters. The patch has been included in releases: 1.0.7, 1.1.2 and 1.2.0

For more information

This issue was initially reported by MessyComposer in #5234.

If you have any questions or comments about this advisory:

Open an issue in tauri Email us at security@tauri.app

Affected versions

crates.io

PackageVulnerableFixed in
Tauri
>= 1.0.0, < 1.0.7
1.0.7
Tauri
>= 1.1.0, < 1.1.2
1.1.2
tauri
>= 1.0.0, < 1.0.7
>= 1.1.0, < 1.1.2
1.0.7
1.1.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

Tauri crates.io → 1.0.7

cargo
cargo update -p Tauri --precise 1.0.7

tauri crates.io → 1.1.2

cargo
cargo update -p tauri --precise 1.1.2

Severity breakdown

CVSS 3.1 2.3

CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:N/A:N

Attack vector
Local
Attack complexity
High
Privileges required
High
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

Weakness

CWE-284: Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

How to prevent it
  • Architecture and Design, Operation: Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-7gmj-67g7-phm9
Tauri has an Origin Confusion Issue that Allows Remote Pages to Invoke Local-Only IPC Commands
High Also affects tauri
GHSA-57fm-592m-34r7
iFrames Bypass Origin Checks for Tauri API Access Control
Medium Also affects tauri
GHSA-wmff-grcw-jcfm
Tauri vulnerable to Regression on Filesystem Scope Checks for Dotfiles
Critical Also affects tauri
GHSA-4wm2-cwcf-wwvp
Tauri Open Redirect Vulnerability Possibly Exposes IPC to External Sites
Medium Also affects tauri
GHSA-6mv3-wm7j-h4w5
Tauri Filesystem Scope Glob Pattern is too Permissive
High Also affects tauri
GHSA-28m8-9j7v-x499
Tauri's readDir Endpoint Scope can be Bypassed With Symbolic Links
Medium Also affects tauri
GHSA-8g5g-mxqh-grgj
Vite: `server.fs.deny` bypassed with queries
Medium Same weakness, CWE-284
GHSA-rq7h-c2jc-7f22
Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine
Medium Same weakness, CWE-284
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor