T09 · Insecure Skill Coding Practices
- Location
SKILL.md:52- Finding
PowerShell Execution Policy Bypass with an Untrusted Relative Script Path
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:52-58;README.md:21-24
Vulnerability Type: Unsafe PowerShell invocation and relative-path execution
Risk Level: MediumThe documentation recommends launching
scripts/self-updater.ps1with PowerShell execution-policy checks disabled:SKILL.md:52-58powershell # Check for updates powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 # Auto-update with smart timing powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 -AutoUpdate -SmartTiming # Full automation (for cron) powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 -AutoUpdate -SmartTiming -AutoApprove -QuietREADME.md:21-24powershell # Check for updates powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 # Auto-update with smart timing powershell -ExecutionPolicy Bypass -File scripts/self-updater.ps1 -AutoUpdate -SmartTimingTechnical Analysis
The
-ExecutionPolicy Bypassoption disables PowerShell execution-policy enforcement for the new process. It therefore suppresses a defense that could otherwise warn about or prevent execution of unsigned or untrusted scripts.The script is also identified through the relative path
scripts/self-updater.ps1. PowerShell resolves that path relative to the process's current working directory, not necessarily relative to the trusted installation directory of the skill. Consequently, the command does not establish that the selected file is the intended updater script.Combining execution-policy bypass with an unverified relative path creates a local arbitrary-code execution opportunity when an attacker can create or replace the referenced file in the working directory. The unattended command additionally uses
-AutoApprove -Quiet, reducing user interaction and visibility during execution.The audited artifact contains only
README.mdandSKILL.md; the referen ...[truncated 1911 chars]- Remediation
View remediation
Remediation Suggestions
- Package
scripts/self-updater.ps1with the skill so that users do not have to obtain or create it separately. - Remove
-ExecutionPolicy Bypassfrom all documented commands. Use an appropriately signed script and a controlled execution policy instead. - Resolve the script from the trusted skill installation directory rather than the caller's current working directory. Use a canonical absolute path derived from a trusted installation root.
- Before execution, verify the script's Authenticode signature or compare its cryptographic digest against a trusted, version-specific manifest.
- Reject execution if the resolved script is outside the expected installation directory, is a symbolic link or reparse point to an unexpected location, or has insecure write permissions.
- Avoid combining unattended approval and quiet operation for update code unless integrity verification has succeeded. Record the resolved script path, version, signer, and verification result in an audit log.
- Correct the repository placeholder in
README.mdand provide a single authoritative source for installation artifacts. - Add automated release checks that fail packaging when documented runtime files are absent or when documentation contains execution-policy bypass commands.
- Package
