mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-12 04:26:57 +00:00
fix(security): resolve all medium severity vulnerabilities
- Ensure yt-dlp partial files are cleaned up on error exits. - Handle Semaphore closure gracefully without panicking. - Replace busy-polling in wait_permit_released with Notify. - Fix extension server silent failure with retry loop and logging. - Ignore malformed existing scheduler settings instead of failing. - Add final symlink checks before revealing/opening downloads. - Delay listener registration in App.tsx until core is ready. - Sanitize Referer header to prevent injection.
This commit is contained in:
@@ -15,6 +15,10 @@ pub async fn reveal_in_file_manager(
|
||||
)
|
||||
})?;
|
||||
|
||||
if std::fs::symlink_metadata(&path).is_ok_and(|metadata| metadata.file_type().is_symlink()) {
|
||||
return Err("Download path was replaced by a symlink before reveal".to_string());
|
||||
}
|
||||
|
||||
app_handle
|
||||
.opener()
|
||||
.reveal_item_in_dir(path.to_string_lossy().as_ref())
|
||||
@@ -33,6 +37,10 @@ pub async fn open_downloaded_file(
|
||||
return Err(format!("Downloaded file is missing: {}", path.display()));
|
||||
}
|
||||
|
||||
if std::fs::symlink_metadata(&path).is_ok_and(|metadata| metadata.file_type().is_symlink()) {
|
||||
return Err("Download path was replaced by a symlink before open".to_string());
|
||||
}
|
||||
|
||||
app_handle
|
||||
.opener()
|
||||
.open_path(path.to_string_lossy().as_ref(), None::<String>)
|
||||
|
||||
Reference in New Issue
Block a user