Back to skill

Security audit

repo-setup

Security checks for vulnerabilities and agentic risk

Overview

This skill performs a coherent repository setup workflow, but it under-protects GitHub tokens and can run untrusted project install/build logic with the user's normal environment.

Review before installing. Use GitHub CLI, SSH, or a credential helper instead of token-in-URL cloning, do not store GH_TOKEN in a shell profile, and only run dependency or build commands for repositories you trust or inside an isolated environment without unrelated secrets.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:53
Finding
GitHub Token Exposure Through Authenticated Clone URL<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 53-64; related persistence guidance at line 153 **Vulnerability Type**: Credential exposure through command-line URL and Git configuration **Risk Level**: High ### Vulnerable Code ```bash if [ -d "$WORKDIR" ]; then cd "$WORKDIR" git fetch --all else mkdir -p "$(dirname "$WORKDIR")" # With token auth git clone "https://${GH_TOKEN}@github.com/${username}/${repo_name}.git" "$WORKDIR" # Or with SSH # git clone "git@github.com:${username}/${repo_name}.git" "$WORKDIR" cd "$WORKDIR" fi ``` The Skill also recommends long-term token persistence: ```markdown - Store GH_TOKEN in your shell profile for persistent auth across sessions. ``` ### Technical Analysis The clone command embeds `GH_TOKEN` directly in an HTTPS URL. Although the shell variable is quoted, its expanded value becomes part of the argument passed to Git. The credential may consequently be exposed through: - Process inspection while the command is running. - Agent, terminal, CI, or command-audit logs. - Git error and diagnostic output. - The repository's `.git/config`, because Git can retain the authenticated URL as the `origin` remote. - Shell configuration files if the recommendation to persist `GH_TOKEN` in a shell profile is followed. GitHub network access and authentication are necessary for private repository operations, but placing the raw token in a URL is not necessary. This behavior exceeds the minimum safe credential exposure required for the declared functionality. ### Attack Path 1. A user exports a GitHub token as `GH_TOKEN`. 2. The Skill expands the token into the `git clone` URL. 3. Git or the surrounding Agent environment records or exposes the resulting command or remote URL. 4. An attacker with access to process information, logs, terminal output, shell configuration, or the cloned repository's `.git/config` recovers the token. 5. The attacker uses the token against GitHub ...[truncated 705 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove token-in-URL authentication entirely. 2. Prefer GitHub CLI credential integration: ```bash gh auth status gh auth setup-git gh repo clone "${username}/${repo_name}" "$WORKDIR" ``` 3. Alternatively, use Git Credential Manager, an operating-system credential store, or SSH authentication. 4. Do not store `GH_TOKEN` in shell profiles. Use an ephemeral environment variable, credential helper, or secret manager only for the duration of the operation. 5. If environment-based authentication is unavoidable, ensure the token is never included in command arguments, URLs, logs, or remote configuration. 6. After cloning, verify that no credentials are present: ```bash git remote get-url origin git config --get remote.origin.url ``` 7. Recommend fine-grained, short-lived tokens restricted to the minimum repositories and permissions. 8. Revoke and rotate any token that may previously have been stored in logs, shell files, or `.git/config`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:43
Finding
Shell Command Injection Through Unvalidated Template Parameters<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 43; additional affected commands at lines 88 and 137 **Vulnerability Type**: Unsafe interpolation of user-controlled values into shell commands **Risk Level**: High ### Vulnerable Code The repository identifier is inserted into a shell command without validation or argument-safe quoting: ```bash gh repo fork {owner}/{repo} --clone=false ``` The branch name is similarly inserted into a command template: ```bash # Create branch from latest upstream git checkout -b {branch_name} upstream/$DEFAULT_BRANCH ``` The documented helper invocation also accepts unvalidated repository, username, and branch parameters: ```bash # One-liner setup scripts/setup_repo.sh owner/repo username fix/branch-name ``` ### Technical Analysis The Skill instructs an Agent to substitute user-provided repository, owner, username, and branch values into shell snippets. The placeholders are not quoted, and the document does not require validation against GitHub identifier or Git reference syntax. If an implementation constructs a shell command from these templates, metacharacters such as command separators, substitutions, redirections, or whitespace can alter the intended command structure. Quoting alone is not sufficient if the implementation first builds a command string and later evaluates it with a shell. The helper script is not present in this project, so its internal behavior cannot be evaluated. The finding concerns the unsafe invocation and substitution pattern documented by this Skill. ### Attack Path 1. An attacker supplies a crafted repository or branch parameter containing shell syntax. 2. The Agent substitutes that value into one of the documented shell command templates. 3. The resulting command is passed to a shell rather than to a process API as a structured argument list. 4. The shell interprets the injected metacharacters as additional commands or redirections. 5. The injected command executes ...[truncated 876 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate every external parameter before using it: - Restrict owners, usernames, and repository names to documented GitHub naming rules. - Validate branch names with `git check-ref-format --branch`. - Reject control characters, whitespace, shell metacharacters, leading option markers, and unexpected URL forms. 2. Pass arguments as a structured array through a process-execution API instead of constructing shell strings. 3. In shell implementations, quote every expansion and use `--` where the command supports it: ```bash gh repo fork "${owner}/${repo}" --clone=false git checkout -b "$branch_name" "upstream/$DEFAULT_BRANCH" ``` 4. Do not use `eval`, `sh -c`, or equivalent execution of dynamically assembled command strings. 5. Define strict parameter parsing in `scripts/setup_repo.sh` and terminate on invalid input before performing any operation. 6. Resolve and constrain working directories to an expected base directory so crafted path components cannot redirect operations to sensitive locations. 7. Present the normalized repository, branch, and destination to the user for confirmation before running commands. ]]>

T08 · Insecure Dependencies

Error
Location
SKILL.md:99
Finding
Automatic Execution of Untrusted Repository Dependency and Build Logic<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 99-115 **Vulnerability Type**: Unsafe dependency installation and repository-controlled build execution **Risk Level**: High ### Vulnerable Code ```markdown ### Step 6: Install Dependencies Detect the project type and install accordingly: | Indicator | Language | Install Command | |-----------|----------|----------------| | `pyproject.toml` / `setup.py` | Python | `pip install -e ".[dev]"` or `pip install -e .` | | `requirements.txt` | Python | `pip install -r requirements.txt` | | `package.json` | Node.js | `npm install` | | `go.mod` | Go | `go mod download` | | `Cargo.toml` | Rust | `cargo build` | | `pom.xml` | Java | `mvn install -DskipTests` | | `build.gradle` | Java/Kotlin | `./gradlew build -x test` | **If full dev install fails** (common with native dependencies): 1. Install core deps individually 2. Skip optional native/GPU deps 3. Ensure test framework is installed at minimum ``` ### Technical Analysis The Skill recommends running package installation and build commands immediately after cloning a user-selected repository. Several listed operations can execute code controlled by that repository or by fetched dependencies: - Python installation may execute build backends and package build hooks. - `npm install` can run package lifecycle scripts. - `cargo build` executes build scripts and procedural build tooling. - Maven can execute configured plugins and build lifecycle actions even when tests are skipped. - `./gradlew` executes a repository-provided wrapper and repository-controlled build configuration. - Dependency resolution can retrieve mutable or compromised third-party components from external registries. Skipping tests does not make these commands safe because execution can occur during dependency resolution, configuration, installation, and compilation. The Skill does not require manifest review, lockfile verification, checksum enforcement, lifecycle-script suppres ...[truncated 1647 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Separate cloning from dependency installation. Complete the clone first and require explicit user approval before executing project-controlled logic. 2. Inspect relevant manifests, lifecycle scripts, build files, wrapper files, and dependency sources before installation. 3. Run dependency installation in an isolated, disposable container or virtual machine with: - No GitHub token, SSH agent, cloud credentials, or unrelated secrets. - A read-only host filesystem except for a dedicated workspace. - Non-root execution. - Restricted outbound network access. - Resource and execution-time limits. 4. Enforce lockfiles and integrity metadata where supported. Reject unexpected registry sources, Git dependencies, local path dependencies, and mutable versions unless explicitly approved. 5. Suppress lifecycle scripts during initial inspection where supported, such as using `npm install --ignore-scripts`; run required scripts only after review. 6. Do not execute a repository-provided Gradle wrapper until its files and configured distribution URL have been reviewed and verified. 7. Use isolated Python virtual environments and review `pyproject.toml`, `setup.py`, and build-system requirements before installation. 8. Avoid inheriting sensitive environment variables into any build or package-manager process. 9. Document that build and install commands execute untrusted code and obtain informed confirmation from the user before proceeding. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The skill instructs cloning with `https://${GH_TOKEN}@github.com/...`, which embeds the GitHub token directly in the command line and remote URL. This can expose the credential through shell history, process inspection, logs, terminal recordings, or persisted Git remote configuration, making accidental token disclosure significantly more likely.

Static analysis

No suspicious patterns detected.