T09 · Insecure Skill Coding Practices
- Location
scripts/install.sh:109- Finding
Indiscriminate Commit of Existing Workspace Contents
- Content
View full analysis
/dev/null; then git config user.email "openclaw-agent@local" git config user.name "OpenClaw Agent" echo " ✅ Set local git identity (openclaw-agent@local)" fi # Create .gitignore create_if_missing "$WORKSPACE/.gitignore" ".env *.secret *.key .DS_Store node_modules/ " git add -A git commit -q -m "Initial workspace setup via openclaw-startup" echo " ✅ Initial commit created" else echo " ⏭️ Git repo already exists" fi ``` ### Technical Analysis When the target workspace is not already a Git repository, the installer initializes one and executes `git add -A`. This stages every unignored file in the workspace, including files that existed before the installer ran. The generated `.gitignore` excludes only a limited set of names and patterns. Sensitive files such as `credentials.json`, configuration exports, database dumps, logs, certificates using extensions such as `.pem` or `.p12`, SSH configuration, and personal documents are not comprehensively excluded. Because the installer immediately creates a commit, any staged sensitive data becomes part of Git history. Deleting the working-tree copy afterward does not remove it from the existing commit. The Git initialization and indiscriminate initial commit are also not clearly identified in the Phase 2 filesystem behavior summary in `SKILL.md`. ### Attack Path 1. A user selects an existing directory that is not currently a Git repository as the OpenClaw workspace. 2. The directory contains a sensitive file not covered by the narrow `.gitignore`, such as `cre ...[truncated 1002 chars]- Remediation
View remediation
