T09 · Insecure Skill Coding Practices
- Location
docs/usage-guide.md:48- Finding
PowerShell Execution-Policy Bypass Combined with Relative Script Resolution
- Content
View full analysis
Vulnerability Details
File Location:
docs/usage-guide.md:48-84;docs/operator-playbook.md:17-34
Vulnerability Type: Unsafe PowerShell execution configuration and relative script path resolution
Risk Level: MediumVulnerable Code
docs/usage-guide.md:48-84:powershell powershell -ExecutionPolicy Bypass -File assets/scripts/task-state.ps1 \ -Action init -TaskId feat-demo -Repo D:/data/code/my-repo -TaskType feature \ -Pipeline implement_and_review -Role implementer -Agent codexpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/task-state.ps1 \ -Action transition -TaskId feat-demo -ToState queued -Reason "ready" -Actor supervisorpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/supervise-task.ps1 \ -TaskId feat-demo -AutoLaunch -ApplyTransition -Jsonpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/supervise-task.ps1 \ -TaskId feat-demo -AutoLaunch -AutoProbe -ApplyTransition -Jsonpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/reconcile-worker.ps1 \ -TaskId feat-demo -Jsonpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/supervise-task.ps1 \ -TaskId feat-demo -Jsondocs/operator-playbook.md:17-34:powershell powershell -ExecutionPolicy Bypass -File assets/scripts/supervise-task.ps1 \ -TaskId feat-demo -AutoLaunch -AutoProbe -ApplyTransition -Jsonpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/reconcile-worker.ps1 \ -TaskId feat-demo -Jsonpowershell powershell -ExecutionPolicy Bypass -File assets/scripts/supervise-task.ps1 \ -TaskId feat-demo -JsonTechnical Analysis
The documented operational workflow explicitly starts PowerShell with
-ExecutionPolicy Bypass. This suppresses execution-policy enforcement for the launched PowerShell process, ...[truncated 2936 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
-ExecutionPolicy Bypassfrom all documented commands. Use the host's configured execution policy rather than disabling it for routine operation. - Ship the referenced scripts as part of the package before documenting them as executable components.
- Resolve scripts from a trusted absolute installation path instead of the current working directory. For example, have a trusted launcher determine the canonical skill directory and construct a fully qualified script path.
- Before execution, canonicalize the script path and verify that it remains within the expected skill installation directory.
- Sign distributed PowerShell scripts and configure environments to require an appropriate signature policy where operationally feasible.
- Publish checksums or package-integrity metadata and verify them before first execution or after updates.
- Restrict write access to the installed skill and script directories so ordinary project content cannot replace orchestration scripts.
- Fail closed when a required script is missing. Do not search alternate working directories or silently accept a same-named replacement.
- If a narrowly scoped policy override is operationally unavoidable, document the reason, require explicit operator confirmation, verify the script's signature or hash first, and limit the override to a trusted absolute file.
- Correct the examples to use valid PowerShell line continuation syntax where applicable, reducing the likelihood that operators rewrite the commands into less controlled forms.
- Remove
