T09 · Insecure Skill Coding Practices
- Location
skill.md:169- Finding
PowerShell Execution Policy Bypass with an Untrusted Relative Script Path
- Content
View full analysis
Vulnerability Details
File Location:
skill.md, lines 169–174; duplicated inREADME.md, lines 28–40, andmeta.json, lines 13–16
Vulnerability Type: Unsafe command execution configuration
Risk Level: MediumVulnerable Code
powershell powershell -ExecutionPolicy Bypass -File ".\script\c-drive-safe-cleanup.ps1"powershell powershell -ExecutionPolicy Bypass -File ".\script\c-drive-safe-cleanup.ps1" -DryRunpowershell powershell -ExecutionPolicy Bypass -File ".\script\c-drive-safe-cleanup.ps1" -LogOutputPath ".\tasks\evaluation-2026-04-22-c-disk-cleanup.md"The corresponding metadata declares:
json "scripts": { "cleanup": "powershell -ExecutionPolicy Bypass -File .\\script\\c-drive-safe-cleanup.ps1", "dry_run": "powershell -ExecutionPolicy Bypass -File .\\script\\c-drive-safe-cleanup.ps1 -DryRun" }Technical Analysis
The documented commands launch PowerShell with
ExecutionPolicy Bypass, suppressing execution-policy enforcement for that process. They also identify the script through a path relative to the caller's current working directory rather than a verified package root or trusted absolute path.The referenced
script/c-drive-safe-cleanup.ps1is absent from the audited artifact, even thoughREADME.mdandmeta.jsonclaim that it is included. Consequently, the intended implementation and its safety properties cannot be audited. More importantly, a file placed at the expected relative path could be executed without execution-policy checks if a user runs the command from an attacker-influenced directory.Execution policy is not a complete security boundary, but explicitly bypassing it removes a defense-in-depth control and increases the consequences of relative-path substitution.
Attack Path
- An attacker gains the ability to create or modify files in the directory from which the user will run the documented command.
- The attacke ...[truncated 841 chars]
- Remediation
View remediation
Remediation Suggestions
- Include
script/c-drive-safe-cleanup.ps1in the distributed artifact and subject its complete implementation to security review. - Remove
-ExecutionPolicy Bypassfrom all commands unless a documented and narrowly justified requirement exists. - Resolve the script path from a trusted installation or repository root rather than the caller's current working directory.
- Verify the script's cryptographic hash or Authenticode signature before execution.
- Ensure the package manifest is generated from actual packaged files so nonexistent implementations cannot be advertised.
- Keep the
DryRunpath subject to the same integrity controls as the destructive execution path. - Update
skill.md,README.md, andmeta.jsontogether so that all invocation examples use the hardened command.
- Include
