Fix issue 2750#2765
Conversation
GSSoC Label Checklist 🏷️@Umbrella-io — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
Closing this PR. It does not fix the issue it claims to address. The issue (#2750) is about a TypeScript/Next.js file — this project has no C# files. The C# files added are standalone stubs with no connection to the existing codebase. The bulk of this PR (+274 lines) is an unrelated new feature ( Please submit genuine contributions. See the cleanup sprint discussion: #2651 |
Summary
This PR validates executable paths and sanitizes arguments within the
ScheduledTaskServiceto prevent arbitrary command execution. It ensures that any task read fromconfig.yamlpoints to an existing file and explicitly blocks common shell interpreters from being registered.Closes #2750
Type of Change
What Changed
string.IsNullOrWhiteSpacecheck insrc/Services/System/ScheduledTaskService.csto prevent empty paths.File.Exists(actionConfig.Path)check to guarantee the path resolves to an actual executable before registering the task.cmd.exe,powershell.exe,wscript.exe,cscript.exe) to mitigate command injection risks.ArgumentException,FileNotFoundException, andUnauthorizedAccessException) when validation fails.How to Test
config.yamlthat usespath: "powershell.exe"with raw string arguments.winhome applyand verify that the operation is rejected with anUnauthorizedAccessExceptioninstead of silently registering the task.FileNotFoundException.Expected result: Invalid or insecure task configurations are rejected immediately without registering persistent startup/logon tasks in Windows Task Scheduler.
Screenshots / Recordings
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
This fix handles the security/UX vulnerability where a misconfigured or malicious
config.yamlcould plant persistent scheduled tasks that survive reboots without user confirmation.