T09 · Insecure Skill Coding Practices
- Location
SKILL.md:45- Finding
Insufficient Gate Command Validation Permits Arbitrary Command Execution
- Content
View full analysis
`, `<`) unless the PRD explicitly marks the phase with `Shell-Gate: true`. Gates that fail this check are rejected with an error. Review all gate commands in your PRD before execution. ``` ```markdown | `Shell-Gate:` | No | `true` | Allow shell metacharacters in gate command (use only for trusted, reviewed gates) | ``` ```markdown 1. If a gate command is specified: - **Validate the gate command first.** Reject commands containing shell metacharacters (`;`, `&&`, `||`, `|`, `$(`, `` ` ``, `>`, `<`) unless the phase includes `Shell-Gate: true`. This prevents accidental or malicious arbitrary shell execution from PRD content. - Run the validated gate command with `exec` ``` ```markdown - Sub-agents run with the same permissions as the parent agent within the workspace directory - Gate commands are run with `exec` in the working directory. Review gate commands before running against production systems. Avoid destructive commands (e.g., `rm -rf`). ``` ### Technical Analysis OpenForge treats a PRD-provided `Gate:` value as a command and executes it through `exec`. Its primary protection is a blocklist of selected shell metacharacters. This does not constrain which executable may be invoked or which arguments may be supplied. Dangerous commands do not necessarily require any blocked characters. For example, destructive utilities, environment-i ...[truncated 2577 chars]- Remediation
View remediation
