T09 · Insecure Skill Coding Practices
- Location
SKILL.md:14- Finding
Unsafe PowerShell Execution-Policy Bypass for an Unavailable Relative Script
- Content
View full analysis
" -CopyToClipboard ``` ``` ### Technical Analysis The skill directs the agent to execute `scripts/generate-mobile-pairing.ps1` with PowerShell's execution policy bypassed. However, the audited package contains only `SKILL.md` and `VERSION.txt`; the referenced script is absent. Because `-File` uses a relative path, script resolution may depend on the process's current working directory rather than a verified package directory. If an attacker can create or replace `scripts/generate-mobile-pairing.ps1` at the resolved location, the agent may execute attacker-controlled PowerShell code. The `-ExecutionPolicy Bypass` option suppresses an execution-policy safeguard that could otherwise prevent or warn about execution of an untrusted script. The skill metadata also claims that the operation automatically reads the local gateway token. Since the implementation is unavailable, its handling of that authentication material cannot be audited. It is therefore impossible to verify whether the token would be embedded in the pairing code, copied to the clipboard, written to a file, or transmitted to the supplied BFF endpoint. ### Attack Path 1. The attacker obtains write access to the agent's working directory or otherwise influences the directory from which the relative script path is resolved. 2. The attacker creates a malicious file at `scripts/generate-mobile-pairing.ps1`. 3. A user invokes the mobile-pairing skill. 4. The agent fo ...[truncated 1159 chars]- Remediation
View remediation
