T09 · Insecure Skill Coding Practices
- Location
SKILL.md:26- Finding
Overbroad Scheduled-Task Matching Can Disable Unrelated Tasks
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 26-38
Vulnerability Type: Overbroad scheduled-task selection and destructive system modification
Risk Level: MediumVulnerable Code
powershell $wpsTasks = Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' } Write-Host "Found $($wpsTasks.Count) WPS scheduled tasks:" $wpsTasks | Select-Object TaskName, State | Format-Table -AutoSize # Disable all WPS scheduled tasks $wpsTasks | ForEach-Object { try { Disable-ScheduledTask -TaskName $_.TaskName -ErrorAction Stop Write-Host "✅ Disabled: $($_.TaskName)" } catch { Write-Host "⚠️ Failed to disable: $($_.TaskName) - $($_.Exception.Message)" } }Technical Analysis
The task selection relies only on the regular expression
WPS|wpsappearing anywhere in a task name. It does not validate the task path, executable action, publisher, author, installation directory, or an allowlist of known WPS task identifiers.PowerShell regular-expression matching is case-insensitive by default, making the explicit alternatives redundant and causing any task name containing the three-character sequence to match. The subsequent call to
Disable-ScheduledTaskomits-TaskPath, which also makes task identification insufficient where similarly named tasks exist in different scheduler folders.The selected tasks are disabled automatically without per-task confirmation or a dry-run stage.
Attack Path
- A scheduled task unrelated to WPS has a task name containing
wps, or such a task is created before the skill is run. - The user executes the documented commands, potentially in an elevated PowerShell session as recommended elsewhere in the skill.
- The substring filter incorrectly classifies the unrelated task as WPS-related.
Disable-ScheduledTaskdisables the task without validating its action, publisher, or task path.- Software main ...[truncated 541 chars]
- A scheduled task unrelated to WPS has a task name containing
- Remediation
View remediation
Remediation Suggestions
- Maintain an allowlist of exact, documented WPS task names and task paths.
- Inspect each task's
Actions,Author, and executable path before classifying it as a WPS task. - Require executable paths to resolve beneath a verified WPS installation directory.
- Pass both
-TaskNameand-TaskPathtoDisable-ScheduledTask. - Present the exact tasks and actions to the user and require confirmation before making changes.
- Provide a dry-run mode using
-WhatIfwhere supported. - Export matching tasks before disabling them so that the original state can be restored.
- Record whether each task was originally enabled and provide a rollback command that restores only tasks changed by the skill.
