Skip to main content

CVE-2022-39215: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in tauri-apps tauri

Medium
Published: Thu Sep 15 2022 (09/15/2022, 21:35:11 UTC)
Source: CVE
Vendor/Project: tauri-apps
Product: tauri

Description

Tauri is a framework for building binaries for all major desktop platforms. Due to missing canonicalization when `readDir` is called recursively, it was possible to display directory listings outside of the defined `fs` scope. This required a crafted symbolic link or junction folder inside an allowed path of the `fs` scope. No arbitrary file content could be leaked. The issue has been resolved in version 1.0.6 and the implementation now properly checks if the requested (sub) directory is a symbolic link outside of the defined `scope`. Users are advised to upgrade. Users unable to upgrade should disable the `readDir` endpoint in the `allowlist` inside the `tauri.conf.json`.

AI-Powered Analysis

AILast updated: 06/21/2025, 23:31:26 UTC

Technical Analysis

CVE-2022-39215 is a medium-severity path traversal vulnerability affecting versions of the Tauri framework prior to 1.0.6. Tauri is a popular framework used to build cross-platform desktop applications by bundling web technologies into native binaries. The vulnerability arises from improper canonicalization in the recursive implementation of the `readDir` API endpoint, which is used to list directory contents within a defined filesystem scope (`fs` scope). Specifically, when `readDir` is called recursively, the framework fails to correctly resolve symbolic links or junction folders that point outside the allowed directory scope. An attacker who can influence the directory structure within the allowed scope can craft symbolic links or junctions that redirect the directory traversal outside the intended boundaries. This allows the application to display directory listings of files and folders outside the restricted scope. However, the vulnerability does not allow arbitrary file content disclosure, only directory listings. The issue was addressed in Tauri version 1.0.6 by adding proper checks to ensure that any symbolic link or junction folder resolved during recursive directory reads remains within the defined scope. Until users upgrade, the recommended mitigation is to disable the `readDir` endpoint in the allowlist configuration (`tauri.conf.json`). There are no known exploits in the wild, and the vulnerability requires the attacker to have some level of influence over the directory structure within the allowed scope, but no authentication or user interaction is explicitly required for exploitation if the application exposes the vulnerable endpoint. This vulnerability is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Potential Impact

For European organizations using Tauri-based desktop applications, this vulnerability could lead to unauthorized exposure of directory structures outside intended application boundaries. While no direct file content leakage is possible, directory listings can reveal sensitive information about the file system layout, presence of specific files or directories, and potentially aid in further targeted attacks or reconnaissance. This could impact confidentiality by exposing metadata about the file system. Integrity and availability are not directly affected by this vulnerability. Organizations in sectors where sensitive data is handled on desktop applications, such as finance, healthcare, or government, may find this exposure problematic. The risk is higher if the vulnerable Tauri applications are used in environments with sensitive or regulated data. Since Tauri is a framework, the actual impact depends on how the affected applications implement and expose the `readDir` functionality. European organizations relying on custom or third-party Tauri apps that have not been updated to version 1.0.6 or later remain vulnerable. The lack of known exploits in the wild reduces immediate risk, but the presence of this vulnerability in a widely used framework warrants prompt attention to prevent potential future exploitation.

Mitigation Recommendations

Upgrade all Tauri framework instances to version 1.0.6 or later, where the vulnerability is fixed by proper symbolic link resolution checks. For applications that cannot immediately upgrade, disable the `readDir` endpoint in the `allowlist` configuration (`tauri.conf.json`) to prevent recursive directory listing calls that could be exploited. Review and audit any custom Tauri applications for exposure of the `readDir` API or similar filesystem access endpoints, ensuring they do not allow untrusted input to influence directory traversal. Implement strict input validation and sanitization on any user-supplied paths or symbolic link inputs within Tauri applications to prevent crafted links from escaping the intended scope. Monitor application logs for unusual directory listing requests or attempts to access symbolic links/junctions that could indicate exploitation attempts. Educate developers using Tauri about secure filesystem access patterns and the importance of canonicalization when handling file paths, especially when symbolic links are involved.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-09-02T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9849c4522896dcbf6991

Added to database: 5/21/2025, 9:09:29 AM

Last enriched: 6/21/2025, 11:31:26 PM

Last updated: 8/7/2025, 1:56:26 AM

Views: 9

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats