Back to skill

Security audit

GitHub 稳定获取

Security checks for vulnerabilities and agentic risk

Overview

This GitHub-fetching skill has a coherent purpose, but its bundled shell scripts can run unsafe clone commands and use third-party mirrors and SSH checks in ways users should review before installing.

Review this skill before installing. Use it only for repositories and paths you trust, avoid passing untrusted branch/ref/target values, and be aware it may contact GitHub plus third-party mirror/CDN services. Prefer direct GitHub or SSH with verified host keys, and verify downloaded code before building or running it.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/github-clone.sh:232
Finding

Arbitrary Command Execution Through Unsafe Shell Command Construction

Content
View full analysis
&1; then ``` ```bash clone_cmd="git clone $DEPTH" if [ -n "$BRANCH" ]; then clone_cmd="$clone_cmd --branch $BRANCH" fi clone_cmd="$clone_cmd $PROXY_URL $TARGET" if timeout $CLONE_TIMEOUT bash -c "$clone_cmd" 2>&1; then ``` ```bash clone_cmd="git clone $DEPTH" if [ -n "$BRANCH" ]; then clone_cmd="$clone_cmd --branch $BRANCH" fi clone_cmd="$clone_cmd $HTTPS_URL $TARGET" if timeout $CLONE_TIMEOUT bash -c "$clone_cmd" 2>&1; then ``` ### Technical Analysis The script constructs shell commands by concatenating caller-controlled values and then evaluates the resulting strings using `bash -c`. Values such as `TARGET`, `BRANCH`, and `OREF` are not quoted or constrained before being inserted into these command strings. Shell metacharacters in these values are consequently interpreted as syntax by the new Bash process rather than being passed to Git as literal arguments. A malicious value can introduce command separators, redirections, pipelines, command substitutions, or comments. The repository URL parser also accepts any non-slash characters for repository owner and repository name fields: ```bash if [[ "$url" =~ ^https://github\.com/([^/]+)/([^/]+)(\.git)?$ ]]; then ``` This allows shell metacharacters to enter generated clone URLs and reach the same `bash -c` execution paths. Although `CLONE_TIMEOUT` is not embedded inside the `bash -c` string, it is also not validated as a positive integer. It can therefore manipulate `timeout` arguments or cause unexpected execution failures. ### Attack Path 1. An attacker causes the Skill to invoke the script with a ...[truncated 1239 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/github-clone.sh:114
Finding

SSH Server Authentication Disabled During GitHub Preflight Check

Content
View full analysis
&1 || true) ``` ### Technical Analysis The SSH preflight check explicitly sets `StrictHostKeyChecking=no`. When GitHub does not already have a trusted host key entry, this setting can accept a key supplied by the endpoint reached through the current DNS and network path without requiring prior authentication of that endpoint. This defeats SSH's protection against first-connection server impersonation. It may also add an unverified key to the user's normal `known_hosts` file. Subsequent SSH clone operations can then rely on trust state created during the insecure preflight check. The script only checks whether the received output contains `successfully authenticated`. An attacker controlling the remote SSH endpoint may return a matching message and cause the script to classify the connection as valid. The presence check for `~/.ssh/id_*.pub` does not itself expose private-key contents. The security issue is the disabled server-authentication control during use of the configured SSH identity. ### Attack Path 1. A victim runs the Skill from a network where an attacker can influence DNS resolution, routing, or traffic to `github.com` on port 22. 2. The victim does not yet have a securely verified GitHub host key, or the relevant trust configuration is otherwise ineffective. 3. The attacker presents an SSH server under the attacker's control. 4. `StrictHostKeyChecking=no` permits the preflight connection without requiring the victim to verify the server identity. 5. The attacker's server returns output containing the expected authentication phrase. 6. The Skill reports SSH as available, and the untrusted key may become part of the user's host trust ...[truncated 754 chars]
Remediation
View remediation
&1 || true ) ``` Additional hardening should include: - Provision GitHub's published SSH host keys through a trusted configuration channel. - Consider a dedicated `UserKnownHostsFile` managed by the Skill rather than modifying the user's global file. - If first-use enrollment is unavoidable, use `StrictHostKeyChecking=accept-new` and clearly disclose that it provides trust-on-first-use rather than prevalidated trust. - Verify host-key fingerprints against GitHub's officially published fingerprints before enrollment. - Avoid recommending blind `ssh-keyscan` output redirection, because `ssh-keyscan` alone does not authenticate the returned key. - Keep `BatchMode=yes` to prevent interactive credential prompts. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/github-clone.sh:252
Finding

Repository and File Content Accepted From Unverified Third-Party Mirrors

Content
View full analysis
&1; then exit 0 fi done ``` ```bash GHPROXY_URL="https://ghproxy.com/https://raw.githubusercontent.com/$REPO/$BRANCH/$FILE" try_download "$GHPROXY_URL" "$OUTPUT" "ghproxy" && { echo "" echo "✅ Saved to: $OUTPUT" echo " File size: $(wc -c < "$OUTPUT") bytes" exit 0 } ``` ### Technical Analysis The scripts retrieve repositories and files through third-party proxy domains and accept the returned content based only on Git or HTTP transport success. They do not require an expected commit identifier, cryptographic digest, or verified signature. TLS authenticates the selected mirror domain, but it does not establish that the mirror returned the same bytes, refs, or Git objects that GitHub would have returned. A compromised, malicious, or incorrectly configured mirror can therefore substitute repository content. For individual files, an HTTP 200 response is treated as sufficient proof of success. For clones, the mirror controls the advertised refs and objects unless the caller independently verifies the resulting commit. ### Attack Path 1. A direct GitHub connection is unavailable, slow, or fails. 2. The Skill falls back to a configured third-party mirror. 3. The mirror is compromised, malicious, or serves poisoned cached content. 4. The mirror returns modified source code, configuration, scripts, or altered ...[truncated 1124 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/github-fetch-file.sh:82
Finding

Direct Non-Atomic Download Can Overwrite Existing Files or Follow Symbolic Links

Content
View full analysis
/dev/null || echo "000") ``` ```bash OUTPUT_DIR=$(dirname "$OUTPUT") if [ "$OUTPUT_DIR" != "." ] && [ ! -d "$OUTPUT_DIR" ]; then mkdir -p "$OUTPUT_DIR" fi ``` ### Technical Analysis The requested output is written directly with `curl -o` without first checking whether the destination already exists, whether it is a symbolic link, or whether another process can replace it between checks and use. Each fallback attempt writes to the same destination. Failed or interrupted requests can therefore replace or leave partial content at an existing path before a later fallback is attempted. Because the download is not staged in a securely created temporary file, there is no atomic transition from verified content to the final destination. If an attacker can create or replace the output path in a shared writable directory, symbolic-link manipulation may redirect the write to another file writable by the Skill process. ### Attack Path 1. The Skill is instructed to save a file to an existing path or to a path inside a directory writable by another local user. 2. An attacker pre-creates the destination as a symbolic link, or races to replace it before `curl` opens the file. 3. `curl -o "$output"` follows the destination and writes through it. 4. The referenced file is overwritten with remote content, provided the Skill process has permission to write to it. 5. Alternatively, an ordinary failed download truncates or partially replaces a legitimate pre-existing output file. ### Impact Assessment The issue can cause data loss and local file replacement within the permissions of ...[truncated 517 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 120)May include surrounding context.

md
|------|------|------|
| Connection timed out | 超时 | 检查网络或稍后重试 |
| Connection refused | 拒绝 | 端口被防火墙阻断 |
| Host key verification failed | SSH host key | `ssh-keyscan github.com >> ~/.ssh/known_hosts` |
| Permission denied | key 未绑定 | 检查 GitHub Settings → SSH Keys |
| Repository not found | 仓库不存在 | 检查仓库地址 |
| already exists | 目录已存在 | 删除或换目录 |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 134)May include surrounding context.

md
ssh-keygen -t ed25519 -C "your@email.com"

# 查看公钥(添加到 GitHub)
cat ~/.ssh/id_ed25519.pub

# 验证连接
ssh -T git@github.com

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation phrases are broad enough to trigger on common user requests about GitHub access, cloning, or network issues, which can cause the skill to run in situations the user did not explicitly intend. Because the skill can initiate network access and choose third-party mirrors automatically, overbroad triggering increases the chance of unintended external connections and content retrieval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documents automatic fallback to ghproxy, jsDelivr, raw.githubusercontent.com, and GitHub API probing, but it does not clearly warn users that requests may be sent to third-party services. This can expose repository names, file paths, branch names, and user intent to external providers without informed consent, which is especially risky in enterprise or private-project contexts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script automatically probes SSH authentication by enumerating local public keys and initiating an SSH connection to GitHub with StrictHostKeyChecking disabled, without explicit prior consent beyond routine status messages. In an agent skill context, this creates an unexpected privacy and network side effect: simply using clone/probe functionality can disclose that SSH keys exist, trigger outbound authentication attempts, and weaken host authenticity checks, which is risky for users who did not expect credential-related probing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script presents its title, usage guidance, status output, and error/help messages entirely in Chinese. For an all-file-types natural-language policy check, this is a locale/language restriction without any opt-in, fallback, or documented justification that the skill is intended only for a Chinese-speaking context.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/github-fetch-file.sh (reported line 47)May include surrounding context.

sh
echo "🔍 探测默认分支..."
    
    # 尝试 GitHub API
    local api_url="https://api.github.com/repos/$repo"
    local response
    
    response=$(timeout 5 curl -fsSL "$api_url" 2>/dev/null || echo "")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

All user-facing instructions, triggers, and operational guidance are presented only in Chinese, without indicating that this is optional or region-specific. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

Comments, usage text, option descriptions, and runtime messages are all presented only in Chinese. Under the policy, forcing a specific language without offering choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.