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:
NimBold
2026-06-25 00:19:18 +03:30
parent 187d70f348
commit 8a258981ce
6 changed files with 221 additions and 143 deletions
+8
View File
@@ -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>)