T09 · Insecure Skill Coding Practices
- Location
SKILL.md:150- Finding
Hidden PowerShell Execution with Execution Policy Bypass
- Content
View full analysis
nul powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File "%~dp0start-openclaw.ps1"' Set-Content -Path "C:\Users\\openclaw-scripts\start-openclaw.bat" -Value $batContent -Encoding ASCII ``` The accompanying instruction explicitly requires the bypass: ```text The .bat must use `-ExecutionPolicy Bypass` to allow the script to run without prompts. ``` ### Technical Analysis The generated batch launcher invokes a PowerShell script with `-ExecutionPolicy Bypass` and `-WindowStyle Hidden`. This combination disables execution-policy checks for the process and conceals script execution from the user. The target `start-openclaw.ps1` is stored in a user-writable scripts directory and is referenced by a relative path derived from `%~dp0`. The launcher does not verify the script's signature, ownership, access-control list, or cryptographic hash before execution. Consequently, any process or account capable of modifying the script can replace it with arbitrary PowerShell code that the trusted desktop shortcut will execute without policy warnings. Execution policy is not a complete security boundary, but bypassing it removes a defense-in-depth control. Hidden execution and redirection of output to `nul` further reduce the likelihood that users will notice tampering or runtime failures. ### Attack Path 1. The user follows the Skill and creates `start-openclaw.bat` and `start-openclaw.ps1` in the Windows user profile. 2. An attacker-controlled process, compromised application, or another account with write permission modifies `start-openclaw.ps1`. 3. The user launches the apparently legitimate OpenClaw desktop shortcut. 4. The batch file starts the altered script with `-ExecutionPolicy Bypass`. 5. ...[truncated 1086 chars]- Remediation
View remediation
