T09 · Insecure Skill Coding Practices
- Location
scripts/council-of-wisdom.sh:110- Finding
Workspace Path Traversal Through Unvalidated Project Names
- Content
View full analysis
" fi if workspace_exists "${name}"; then error "Workspace '${name}' already exists." fi log "Initializing Council of Wisdom workspace: ${name}" local workspace="${WORKSPACE_ROOT}/${name}" # Create directory structure mkdir -p "${workspace}"/{workspace/{monitoring,testing,feedback,prompts/council,agents,logs,reports},.github/workflows} # ... log "Initializing git repository..." cd "${workspace}" git init git add . git commit -m "Initial commit: Council of Wisdom workspace - ${name}" } ``` ### Technical Analysis The project name is incorporated directly into a filesystem path without rejecting absolute paths, directory separators, `..` components, or symlink-based escapes. Shell quoting protects against shell metacharacter injection, but it does not guarantee that the resulting path remains beneath `WORKSPACE_ROOT`. For example, a project name such as `../../../tmp/external-project` causes the resolved workspace path to escape the intended Council of Wisdom workspace. The script subsequently creates directories, writes generated files, changes into that location, and initializes or modifies Git state. Symbolic links inside the workspace path could produce a similar boundary escape unless the canonical target is verified. ### Attack Path 1. An attacker or untrusted caller invokes: ```bash council-of-wisdom init ../../../tmp/external-project ``` 2. The script constructs: ```text ${WORKSPACE_ROOT}/../../../tmp/external-project ``` 3. `mkdir -p` creates directories outside the configured ...[truncated 827 chars]- Remediation
View remediation
