Back to skill

Security audit

GitHub Accelerator

Security checks for vulnerabilities and agentic risk

Overview

This GitHub mirror helper is mostly purpose-aligned, but it contains unsafe clone cleanup that can delete an existing folder and guidance for authenticated repository writes.

Review this skill before installing. Use it only for public GitHub resources or trusted private proxy infrastructure, avoid signed or credential-bearing URLs, never pass an existing directory as the clone destination, and require explicit confirmation before any API-based commit/ref update or persistent proxy config change. The clone cleanup behavior should be fixed before routine use.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/gh_accel.sh:151
Finding
Failed clone operations can recursively delete an existing user-controlled directory<![CDATA[ ## Vulnerability Details **File Location**: `scripts/gh_accel.sh`, lines 151-172 **Vulnerability Type**: Unsafe recursive deletion of a user-controlled path **Risk Level**: High ### Vulnerable Code ```bash cmd_clone() { local no_direct=0 repo dir if [ "$1" = "--no-direct" ]; then no_direct=1; repo="$2"; dir="${3:-}" else repo="$1"; dir="${2:-}" fi repo="${repo#https://github.com/}"; repo="${repo%.git}" [ -z "$dir" ] && dir="$(basename "$repo")" if [ $no_direct -eq 0 ]; then echo "→ 直连: https://github.com/$repo" if git clone "https://github.com/$repo" "$dir"; then echo "✅ 直连 clone 成功 -> $dir" return 0 fi rm -rf "$dir" echo " ✗ 直连失败,降级镜像…" fi for base in "${CLONE_PROXIES[@]}"; do echo "→ 镜像: $base/$repo" if git clone "$base/$repo" "$dir"; then echo "✅ 经镜像 clone 成功 -> $dir" echo "⚠️ remote 指向镜像,push 前执行:" echo " git -C $dir remote set-url origin https://github.com/$repo.git" return 0 fi rm -rf "$dir" echo " ✗ 失败" done ``` ### Technical Analysis The clone destination is taken directly from a command-line argument and passed to `rm -rf` whenever a clone attempt fails. The script does not verify that the destination was created by the current invocation. A normal `git clone` operation fails when its destination already exists and is not empty. Consequently, supplying an existing directory causes the clone to fail and immediately triggers recursive deletion of that directory. The same unsafe cleanup occurs after each failed mirror attempt. There are no canonical-path checks, protected-path checks, ownership checks, or state flags recording whether the script created the destination. The `rm` invocation also lacks the `--` option terminator, which is an additional unsafe path-handling practice for option-like names. ### Attack Path 1. An attacker, unsafe automation workflow, or mistaken user supplies a valuable existing directory as the dest ...[truncated 1000 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Refuse to operate when the requested destination already exists: ```bash if [ -e "$dir" ] || [ -L "$dir" ]; then printf 'Error: destination already exists: %s\n' "$dir" >&2 return 1 fi ``` 2. Create a private temporary directory and clone into it. Rename it to the requested destination only after a successful clone. 3. Track explicitly whether the current invocation created a path. Cleanup must only remove a path proven to have been created by that invocation. 4. Canonicalize and validate the destination before use. Reject empty paths, root directories, home directories, parent traversal, protected locations, and option-like path values. 5. Use an option terminator for deletion: ```bash rm -rf -- "$temporary_directory" ``` 6. Install an `EXIT` trap that cleans only the private temporary directory, rather than deleting the final user-selected destination after clone failures. 7. Add regression tests covering pre-existing non-empty directories, symlinks, relative traversal paths, option-like names, and failed direct and mirror clone attempts. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/gh_accel.sh:126
Finding
Unrestricted download URLs enable internal requests, local file overwrite, and URL disclosure to public mirrors<![CDATA[ ## Vulnerability Details **File Location**: `scripts/gh_accel.sh`, lines 126-150 **Vulnerability Type**: Unrestricted network destination with unsafe output-file handling **Risk Level**: Medium ### Vulnerable Code ```bash cmd_dl() { local no_direct=0 url="${2:-$1}" [ "$1" = "--no-direct" ] && no_direct=1 [[ "$url" == http* ]] || url="https://$url" local out="$(basename "${url%%\?*}")" [ -z "$out" ] && out="download.bin" if [ $no_direct -eq 0 ]; then echo "→ 直连: $url" code=$(fetch "$url" "$out" 60) if [ "$code" = "200" ] && [ -s "$out" ]; then echo "✅ 直连成功 -> $out ($(du -h "$out" | cut -f1))" return 0 fi echo " ✗ 直连失败 (http=$code),降级镜像…" fi for p in "${DL_PROXIES[@]}"; do echo "→ 镜像: $p" code=$(fetch "$p/$url" "$out" 90) if [ "$code" = "200" ] && [ -s "$out" ]; then echo "✅ 经 $p 下载成功 -> $out ($(du -h "$out" | cut -f1))" return 0 fi echo " ✗ $p 失败 (http=$code)" done echo "❌ 全部通道失败。跑 'gh_accel.sh check' 看镜像状态,或找新镜像更新 DL_PROXIES" return 1 } ``` The underlying fetch routine writes directly to the selected output path: ```bash fetch() { local code rc code=$(curl -sL --max-time "$3" -o "$2" -w '%{http_code}' "$1" 2>/dev/null) rc=$? [ $rc -ne 0 ] && code=000 echo "${code:-000}" } ``` ### Technical Analysis The documented purpose is to download GitHub resources, but the implementation does not validate the URL scheme or hostname against an approved GitHub allowlist. Any HTTP or HTTPS endpoint accepted by `curl` can therefore be requested, including loopback addresses, private-network services, and non-GitHub Internet hosts. The output filename is derived from the URL basename and written directly into the current working directory. The code does not check whether the destination already exists or is a symbolic link. `curl -o` can consequently overwrite an existing writable file or follow an attacker-prepared symlink. If direct access fails, the complete ...[truncated 2379 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse the URL and require the `https` scheme. 2. Enforce an explicit hostname allowlist appropriate to the stated purpose, such as approved GitHub download hosts. Reject loopback, link-local, private-network, and unrecognized destinations. 3. Reject URLs containing user information or sensitive query parameters. Do not send authenticated, signed, private, or token-bearing URLs through public mirrors. 4. Require the caller to provide an explicit output path, or create a private temporary file with `mktemp`. 5. Refuse to overwrite existing files or symbolic links. Download into a newly created temporary file and atomically rename it only after validation succeeds. 6. Remove partial temporary files after failed transfers rather than reusing the final destination across fallback attempts. 7. Validate downloaded resources using an expected cryptographic digest when available. A non-empty HTTP 200 response does not establish integrity. 8. Clearly separate public GitHub mirror mode from direct arbitrary-URL mode. Arbitrary URLs, if supported at all, should never be forwarded to third-party mirrors without explicit informed confirmation. 9. Add tests for non-GitHub hosts, private IP ranges, credentials in URLs, signed query strings, existing output files, symlinks, redirects to disallowed hosts, and interrupted transfers. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill directs the agent to run shell commands and access the network but does not declare corresponding permissions or constraints. That mismatch can cause the agent to perform external downloads, clones, and API operations without explicit policy review, increasing the chance of unintended code retrieval or data egress.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill's stated purpose is read-only GitHub acceleration, but it also instructs using GitHub API endpoints to create blobs, trees, commits, and update refs as a substitute for git push. This materially expands the skill from download/clone fallback into authenticated repository write operations, which can be abused to modify code remotely or bypass expected guardrails around push workflows.

Context-Inappropriate Capability

Low
Confidence
80% confidence
Finding
The skill instructs the agent to write proxy configuration entries into a user-local file, which exceeds a purely informational mirror fallback role and modifies persistent local state. Even though the path is user-scoped, this can redirect future network traffic through arbitrary infrastructure and create privacy or supply-chain risk if the configured proxy is untrusted.

Static analysis

No suspicious patterns detected.