Skip to main content

CVE-2022-46171 — Vulnerability in tauri — CVE Details

MEDIUM

Tauri Filesystem Scope Glob Pattern is too Permissive

Published December 22, 2022Updated November 8, 2023Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (1.07%). Schedule for your next planned update.

Does your project use an affected tauri version?

Paste your Cargo.lock to check it for CVE-2022-46171 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

Impact

The filesystem glob pattern wildcards *, ?, and [...] match file path literals and leading dots by default, which unintentionally exposes sub folder content of allowed paths.

Example: The fs scope $HOME/*.key would also allow $HOME/.ssh/secret.key to be read even though it is in a sub directory of $HOME and is inside a hidden folder.

Scopes without the wildcards are not affected. As ** allows for sub directories the behavior there is also as expected.

Patches

The issue has been patched in the latest release and was backported into the currently supported 1.x branches.

Workarounds

No workaround is known at the time of publication.

References

The original report contained information that the dialog.open component automatically allows one sub directory to be read, regardless of the recursive option.

Imagine a file system looking like

 o ../
 o documents/
    - file.txt
    - deeper/
       o deep_file.txt

Reproduction steps:

  1. Trying to load “file.txt” or “deep_file.txt” doesn’t work. Expected
  2. Select “documents” as folder to open(ie. with window.TAURI.dialog.open)
  3. Trying to load “file.txt” works. Expected
  4. Trying to load “deep_file.txt” also works, which isn’t expected

The recursive flag is used in https://github.com/tauri-apps/tauri/blob/cd8c074ae6592303d3f6844a4fb6d262eae913b2/core/tauri/src/scope/fs.rs#L154 to scope the filesystem access to either files in the folder or to also include sub directories.

The original issue was replicated and further investigated.

The root cause was triaged to the glob crate facilitating defaults, which allow the * and [...] to also match path literals.

MatchOptions {
    case_sensitive: true,
    require_literal_separator: false,
    require_literal_leading_dot: false
}

This implicated that not only the dialog.open component was affected but rather all fs scopes containing the * or [...] glob. During this investigation it became obvious that the current glob matches would also match hidden folder (e.g: .ssh) content by default, without explicitly allowing hidden folders to be matched. This is not commonly expected behavior in comparison to for example bash.

The new default Match options are:

MatchOptions {
    case_sensitive: true,
    require_literal_separator: true,
    require_literal_leading_dot: true
}

Another note security relevant for developers building applications interacting with case sensitive filesystems is, that the case_sensitive option only affects ASCII file paths and is not valid in Unicode based paths. This is considered a known risk until the glob crate supports non-ASCII file paths for this type of case sensitive matching.

For more Information

If you have any questions or comments about this advisory:

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

Advisory Timeline

  • First published December 22, 2022 (1435 days ago).
  • Last revised November 8, 2023 — 320 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update tauri to 1.1.3 or later
cargo update -p tauri --precise 1.1.3
Cargo
Update tauri to 1.2.3 or later
cargo update -p tauri --precise 1.2.3
Cargo
Update tauri to 2.0.0-alpha.2 or later
cargo update -p tauri --precise 2.0.0-alpha.2
Cargo
Update tauri to 1.0.8 or later
cargo update -p tauri --precise 1.0.8

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
tauri crates.io · Affected: All versions1.1.3
tauri crates.io · Affected: All versions1.2.3
tauri crates.io · Affected: All versions2.0.0-alpha.2
tauri crates.io · Affected: All versions1.0.8

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.8 score means for each attack dimension.

Attack Vector
Adjacent
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

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

Frequently Asked Questions

What is CVE-2022-46171?
Tauri Filesystem Scope Glob Pattern is too Permissive. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
How do I check if my project is affected by CVE-2022-46171?
CVE-2022-46171 affects tauri. It has a 1.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-46171 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.8

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
1.07%
EPSS percentile: 64.3

This is an above-median EPSS score — 64.3% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-6mv3-wm7j-h4w5

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock