CVE-2022-39215: Tauri Tauri's ReadDir Endpoint Scope Can Vulnerability
MODERATECVE-2022-39215 is a MODERATE (CVSS 5.8) tauri's readdir endpoint scope can vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Tauri libraries in the crates.io ecosystem. The issue involves tauri's readdir endpoint scope can be bypassed with symbolic links. Remediation is available by upgrading affected packages to version 1.0.6.
CVE-2022-39215 at a Glance
Security Impact
CVSS: 5.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N).
How to Fix CVE-2022-39215
To remediate this vulnerability, upgrade all affected Tauri dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade tauri to 1.0.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for tauri
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-39215, inspect your project dependencies for Tauri:
inspect dependencies for tauri
Analyze the terminal output to locate any version of Tauri in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.6), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Tauri, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-39215 Affected Tauri Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tauri
|
crates.io |
< 1.0.6
|
1.0.6
|
References
Frequently Asked Questions
What is CVE-2022-39215?
Which Tauri versions are affected?
What version fixes CVE-2022-39215?
Is tauri affected?
What is the CVSS score of CVE-2022-39215?
What CWE is associated with CVE-2022-39215?
How can I check crates.io dependencies for CVE-2022-39215?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-28m8-9j7v-x499",
"modified" : "2022-09-22T17:28:05Z",
"published" : "2022-09-16T19:28:49Z",
"aliases" : [ "CVE-2022-39215" ],
"summary" : "Tauri's readDir Endpoint Scope can be Bypassed With Symbolic Links",
"details" : "### Impact\nDue 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.\n\n\n### Patches\nThe issue has been resolved in https://github.com/tauri-apps/tauri/pull/5123 and the implementation now properly checks if the\nrequested (sub) directory is a symbolic link outside of the defined `scope`.\n\n### Workarounds\nDisable the `readDir` endpoint in the `allowlist` inside the `tauri.conf.json`.\n\n### For more information\n\nThis issue was initially reported by [martin-ocasek]( https://github.com/martin-ocasek) in [#4882](https://github.com/tauri-apps/tauri/issues/4882).\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [tauri](https://github.com/tauri-apps/tauri)\n* Email us at [security@tauri.app](mailto:security@tauri.app)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "tauri"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tauri-apps/tauri/security/advisories/GHSA-28m8-9j7v-x499"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39215"
}, {
"type" : "WEB",
"url" : "https://github.com/tauri-apps/tauri/issues/4882"
}, {
"type" : "WEB",
"url" : "https://github.com/tauri-apps/tauri/pull/5123"
}, {
"type" : "WEB",
"url" : "https://github.com/tauri-apps/tauri/pull/5123/commits/1f9b9e8d26a2c915390323e161020bcb36d44678"
}, {
"type" : "WEB",
"url" : "https://github.com/tauri-apps/tauri/commit/bb178829086e80916f9be190f02d83bc25802799"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tauri-apps/tauri"
}, {
"type" : "WEB",
"url" : "https://github.com/tauri-apps/tauri/releases/tag/tauri-v1.0.6"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0088.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-59" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-16T19:28:49Z",
"nvd_published_at" : "2022-09-15T22:15:00Z"
}
}