Summary
Readest desktop transfer commands accepted file paths controlled by the webview without checking them against the Tauri filesystem scope or blocking absolute paths and parent-directory traversal. If JavaScript executes in the privileged application origin, it may be able to read files accessible to the process or overwrite writable files.
Readest desktop transfer commands accepted file paths controlled by the webview without checking them against the Tauri filesystem scope or blocking absolute paths and parent-directory traversal. If JavaScript executes in the privileged application origin, it may be able to read files accessible to the process or overwrite writable files.
Affected context
The issue affects desktop Tauri builds of Readest prior to 0.11.10. The download_file and upload_file commands were registered for the main, updater, and reader-* windows and used webview-controlled paths for file operations without enforcing the Tauri filesystem scope. Exploitation depends on JavaScript executing in the privileged application origin; whether JavaScript embedded in a book can reach that origin was not established.
The issue affects desktop Tauri builds of Readest prior to 0.11.10. The download_file and upload_file commands were registered for the main, updater, and reader-* windows and used webview-controlled paths for file operations without enforcing the Tauri filesystem scope. Exploitation depends on JavaScript executing in the privileged application origin; whether JavaScript embedded in a book can reach that origin was not established.
Exploit preconditions
- Attack surface: The desktop application's Tauri command interface.
- Required access: JavaScript execution in the privileged application origin, for example through an application XSS or a compromised renderer.
- Trigger point: Invocation of
download_fileorupload_filewith a path processed by the command. - Why exploitation is possible: The commands pass the supplied path to file operations without checking filesystem scope, rejecting absolute paths, or blocking parent-directory traversal.
- Attack surface: The desktop application's Tauri command interface.
- Required access: JavaScript execution in the privileged application origin, for example through an application XSS or a compromised renderer.
- Trigger point: Invocation of
download_fileorupload_filewith a path processed by the command. - Why exploitation is possible: The commands pass the supplied path to file operations without checking filesystem scope, rejecting absolute paths, or blocking parent-directory traversal.
Why this happens
The commands trusted webview-controlled path values and used them directly in file operations without constraining which filesystem locations could be accessed. This is a path traversal and path restriction failure, mapping to CWE-22: input containing absolute paths or parent-directory components can escape the intended directory or scope.
The commands trusted webview-controlled path values and used them directly in file operations without constraining which filesystem locations could be accessed. This is a path traversal and path restriction failure, mapping to CWE-22: input containing absolute paths or parent-directory components can escape the intended directory or scope.
Potential impact
- An attacker could read files accessible to the application process, potentially exposing keys, tokens, or other secrets.
- An attacker could overwrite writable files, including trusted or startup files.
- Changes to trusted files could disrupt the application or affect its subsequent behavior.
- The impact is limited by the permissions and filesystem access of the application process.
- An attacker could read files accessible to the application process, potentially exposing keys, tokens, or other secrets.
- An attacker could overwrite writable files, including trusted or startup files.
- Changes to trusted files could disrupt the application or affect its subsequent behavior.
- The impact is limited by the permissions and filesystem access of the application process.
General mitigation guidance
Defensive patterns include:
- Restrict file operations to explicitly authorized directories using the framework's filesystem scope.
- Resolve and canonicalize paths, then verify that the resolved location remains within an approved base directory.
- Reject absolute paths and traversal components rather than relying on client-side checks.
- Prefer narrow, purpose-specific file APIs over commands that accept arbitrary paths.
- Minimize the privileges available to the application process and limit access to sensitive files.
- Treat webview input as untrusted, even when it originates from application UI.
Defensive patterns include:
- Restrict file operations to explicitly authorized directories using the framework's filesystem scope.
- Resolve and canonicalize paths, then verify that the resolved location remains within an approved base directory.
- Reject absolute paths and traversal components rather than relying on client-side checks.
- Prefer narrow, purpose-specific file APIs over commands that accept arbitrary paths.
- Minimize the privileges available to the application process and limit access to sensitive files.
- Treat webview input as untrusted, even when it originates from application UI.
How teams detect issues like this
Review command handlers that accept paths from webview or other untrusted inputs and check whether they enforce filesystem scope after path normalization. Static analysis can flag direct use of externally supplied paths in file-open and file-create operations. Code review and policy checks can also look for missing traversal defenses, overly broad Tauri permissions, and commands exposed to privileged windows. Automated security review tools may help identify these patterns.
Review command handlers that accept paths from webview or other untrusted inputs and check whether they enforce filesystem scope after path normalization. Static analysis can flag direct use of externally supplied paths in file-open and file-create operations. Code review and policy checks can also look for missing traversal defenses, overly broad Tauri permissions, and commands exposed to privileged windows. Automated security review tools may help identify these patterns.

