T09 · Insecure Skill Coding Practices
- Location
workflow.json:18- Finding
Unvalidated Test Command Is Passed to a Privileged Execution Skill
- Content
View full analysis
Vulnerability Details
File Location:
workflow.json, lines 18-22 and 95-102
Vulnerability Type: Command injection risk through unrestricted workflow input
Risk Level: HighVulnerable Code
json "test_command": { "type": "string", "default": "npm test", "description": "Test command used by auto-pr-merger to rerun tests" }json "input": { "pr": "${inputs.pr}", "test": "${inputs.test_command}", "retries": 2, "auto_merge_if_passed": true }Technical Analysis
The workflow accepts
test_commandas an unrestricted string and passes it directly to the write-capableauto-pr-mergerSkill. The configuration does not define an executable allowlist, argument schema, shell-metacharacter filtering, working-directory restriction, or sandbox requirement.The implementation of
auto-pr-mergeris not included in this project, so this audit cannot confirm how it invokes the command. If that Skill executes the value through a shell, an attacker who can control workflow parameters could inject additional commands. Even without shell interpretation, allowing callers to select arbitrary executables exceeds what is necessary to run repository tests.Attack Path
- An attacker or untrusted automation gains the ability to invoke the Skill and control
test_command. - The attacker supplies a command containing an unintended executable or, if shell interpretation is used, command separators and a secondary payload.
- The workflow forwards the string unchanged to
auto-pr-merger. - The delegated Skill executes the test command in the repository or agent environment.
- The injected process operates with the filesystem, network, credentials, and repository permissions available to the agent.
Exploitation depends on the command-execution semantics of the external
auto-pr-mergerSkill, which are not present in this package.Impact Assessment
Successful exploitation could provide command execution with the agent's p ...[truncated 494 chars]
- An attacker or untrusted automation gains the ability to invoke the Skill and control
- Remediation
View remediation
Remediation Suggestions
- Remove free-form command input from untrusted callers.
- Replace
test_commandwith an enum of repository-approved test tasks, such asunit,integration, orlint. - Resolve each task to a fixed executable and fixed argument array maintained in trusted configuration.
- Invoke the executable directly without a shell.
- If customization is essential, reject shell metacharacters and validate every argument against a strict allowlist.
- Run tests in an ephemeral container with no production credentials, read-only host mounts, restricted outbound networking, and resource limits.
- Give the test process a short-lived repository credential with no merge or administrative permissions.
- Log the resolved executable and arguments and require approval when they differ from repository-owned configuration.
