T06 · System Persistence
- Location
scripts/install-session-recall-scheduler.ps1:8- Finding
Optional Installation of a Persistent Recurring Windows Scheduled Task
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install-session-recall-scheduler.ps1, lines 8-28
Vulnerability Type: Persistent scheduled-task execution
Risk Level: Highpowershell $TaskName = "CopilotSessionRecallSync" $Action = New-ScheduledTaskAction ` -Execute "powershell.exe" ` -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$SkillScript`" sync-copilot --limit 200 --graph" $Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1) ` -RepetitionInterval (New-TimeSpan -Minutes $EveryMinutes) $Settings = New-ScheduledTaskSettingsSet ` -AllowStartIfOnBatteries ` -DontStopIfGoingOnBatteries ` -StartWhenAvailable Register-ScheduledTask ` -TaskName $TaskName ` -Action $Action ` -Trigger $Trigger ` -Settings $Settings ` -Description "Sync Copilot native sessions into the local Session Recall index and graph." ` -Force | Out-NullTechnical Analysis
When installation is invoked with the documented
-InstallScheduleroption,install.ps1calls this scheduler installer. The script registers a recurring Windows scheduled task that survives the original Skill execution and runs every 30 minutes by default.The task starts PowerShell with
-ExecutionPolicy Bypassand executessession-recall.ps1 sync-copilot --limit 200 --graph. Each run can read up to 200 sessions from the user's private Copilot session database and update persistent Markdown, JSON, SQLite, and graph data under~/SessionRecall.This behavior is optional and documented, and the audit found no evidence that it uploads session data or communicates with a remote endpoint. Nevertheless, it establishes cross-session execution persistence. The use of
-Forcecan replace an existing task with the same name, while-ExecutionPolicy Bypassweakens a defense-in-depth control for every scheduled invocation. No corresponding uninstall mechanism is included....[truncated 1505 chars]
- Remediation
View remediation
Remediation Suggestions
- Keep scheduled synchronization separate from the normal Skill installation and require explicit, informed confirmation immediately before registration.
- Display the exact task name, command, script path, interval, data source, and destination before creating the task.
- Remove
-ExecutionPolicy Bypass; use a signed script and an appropriately restrictive execution policy where possible. - Avoid unconditional
-Force. Detect an existing same-named task and require separate confirmation before replacing it. - Validate
EveryMinutesagainst a safe minimum and maximum to prevent unexpectedly frequent background processing. - Pin the scheduled action to trusted, access-controlled script files and verify their integrity before each execution.
- Provide a documented uninstall command or script using
Unregister-ScheduledTask -TaskName "CopilotSessionRecallSync". - Offer manual, on-demand synchronization as the default least-privilege mode.
- Clearly document that synchronization creates persistent copies of sensitive conversation content and provide a cleanup procedure for
~/SessionRecall.
