T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/auto-sync.sh:10
- Finding
- Automatic Git synchronization can upload API keys, private keys, and request data<![CDATA[ ## Vulnerability Details **File Location**: `scripts/auto-sync.sh:10-19` **Vulnerability Type**: Indiscriminate staging and remote upload of sensitive files **Risk Level**: Critical ### Vulnerable Code ```bash git add -A if git diff --cached --quiet; then # No changes exit 0 fi # Commit and push changes TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC") git commit -m "Auto-sync: $TIMESTAMP" --quiet git push origin main --quiet ``` ### Technical Analysis The synchronization script stages every changed or untracked file under the repository through `git add -A`, commits those files, and pushes them to the configured `origin` remote. This project stores sensitive material inside the project directory, including: - `.env`, which may contain the HeySummon API key and notification target. - `providers.json`, which stores provider API keys. - `.keys/`, which contains signing and encryption private keys. - `.requests/`, which contains active request identifiers and provider metadata. - Watcher logs and event records that may contain conversation content. The repository snapshot contains no `.gitignore`, although `README.md` states that these paths are already ignored. Consequently, the documented auto-sync behavior does not have the protection claimed by the documentation. ### Attack Path 1. A user configures the Skill and creates `.env`, `providers.json`, `.keys/`, or `.requests/`. 2. The user runs or schedules `scripts/auto-sync.sh` as documented. 3. `git add -A` stages all sensitive and non-sensitive files without an allowlist. 4. The script commits the staged files. 5. `git push origin main` uploads them to the configured Git remote. 6. Anyone with access to that remote can retrieve API credentials, private keys, request metadata, or logs. An attacker who controls or can modify the `origin` remote gains a direct exfiltration channel when the synchronization script runs. ### Impact Assessment Successful exploitation can disclose HeySummon API ke ...[truncated 449 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Add a restrictive `.gitignore` that excludes at minimum: - `.env` - `providers.json` - `.keys/` - `.requests/` - `.seen-events.txt` - `*.jsonl` - `scripts/watcher.log` - `scripts/watcher.pid` 2. Replace `git add -A` with an explicit allowlist of documentation and source files intended for publication. 3. Before committing, inspect `git diff --cached --name-only` and abort if any sensitive path is staged. 4. Add automated secret scanning before every push. 5. Do not enable scheduled synchronization by default; require explicit informed consent. 6. Rotate any API keys and cryptographic keys that may already have been pushed, and remove exposed data from the complete Git history. ]]>
