Back to skill

Security audit

Github Contribution

Security checks for vulnerabilities and agentic risk

Overview

The skill is a legitimate GitHub contribution helper, but it can automatically discard local repository work and recommends broader GitHub token permissions than its workflow appears to need.

Review this skill before installing. Use it only on disposable or freshly cloned fork directories, not repositories containing local work. Before running the script, manually check git status, save or back up commits, and avoid broad classic GitHub tokens; prefer existing GitHub CLI or SSH auth, or fine-grained credentials limited to the relevant fork/repository.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/github-contribution.sh:46
Finding

Destructive Repository Reset Without Adequate State Validation

Content
View full analysis
/dev/null; then echo "🔗 添加官方仓库作为 upstream 远程" git remote add upstream "https://github.com/${OWNER_REPO}.git" else echo "🔗 Upstream 远程已存在" fi # 5. 确保在 main/master 分支并同步到最新 echo "🔄 同步你的 Fork 到官方最新状态" git checkout main 2>/dev/null || git checkout master git fetch upstream git reset --hard upstream/main 2>/dev/null || git reset --hard upstream/master ``` The related synchronization example in `SKILL.md`, lines 223-228, is even more destructive: ```bash git checkout main git fetch upstream git reset --hard upstream/main git clean -fdx # Remove all untracked files ``` ### Technical Analysis When the target directory already exists, the script reuses it without checking whether it contains: - Modified or staged tracked files - Untracked work - Ignored local configuration - Unpushed commits - An interrupted merge or rebase - Work that belongs to another repository or worktree The script then checks out the default branch and executes `git reset --hard`, which overwrites the index and working tree to match the fetched upstream branch. The documented `git clean -fdx` command additionally delete ...[truncated 1963 chars]
Remediation
View remediation
/dev/null 2>&1 || { echo "Target directory is not a Git repository." exit 1 } if [[ -n "$(git status --porcelain=v1 --untracked-files=all)" ]]; then echo "Repository contains uncommitted or untracked work; aborting." exit 1 fi ``` 2. Detect interrupted operations such as merges and rebases before changing branches. 3. Verify repository identity using normalized, exact owner/repository values rather than substring matching. Resolve HTTPS and SSH URL forms to the same canonical identifier. 4. Confirm that local commits are reachable from a remote branch before resetting. 5. Create a recovery reference before any destructive operation: ```bash backup_branch="backup/pre-sync-$(date +%Y%m%d-%H%M%S)" git branch "$backup_branch" HEAD ``` 6. Prefer a new clone or isolated Git worktree instead of reusing an arbitrary existing directory. 7. Require explicit confirmation that displays the repository path, current branch, commits that will be replaced, and files that will be discarded. 8. Remove `git clean -fdx` from the default workflow. If cleanup is genuinely necessary, first show a dry run with `git clean -ndx`, obtain explicit approval, and avoid deleting ignored configuration by default. 9. Do not suppress reset errors with `2>/dev/null`; report which branch and command failed so the user can make an informed decision. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:453
Finding

Over-Broad GitHub Token Permission Recommendation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The skill recommends git reset --hard upstream/main, which forcibly discards local commits and working tree changes. In an agent skill context, this is dangerous because an automated agent may execute it in the wrong repository, wrong branch, or without explicit user confirmation, causing irreversible data loss and potentially wiping unpushed work.

Content

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

md
git checkout main
git fetch upstream
git reset --hard upstream/main
git clean -fdx  # Remove all untracked files

# Verify clean state

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The skill instructs use of git clean -fdx, which removes all untracked files including ignored files. In a real developer workspace this can delete local configuration, build artifacts, secrets in ignored files, notes, and other unrecoverable data; in an automated skill, the risk is amplified because the agent may run it broadly without accurately understanding repository boundaries.

Content

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

md
git checkout main
git fetch upstream
git reset --hard upstream/main
git clean -fdx  # Remove all untracked files

# Verify clean state
if [[ $(git status --porcelain) ]]; then

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · github-contribution-workflow.md (reported line 34)May include surrounding context.

git merge upstream/main

推送到你的 fork

git push origin main

text

## 2. 创建功能分支

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · github-contribution-workflow.md (reported line 34)May include surrounding context.

git merge upstream/main

推送到你的 fork

git push origin main

text

## 2. 创建功能分支

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

git reset --hard is a destructive operation applied to a user-selected working tree path and is triggered automatically as part of the workflow. Because the script may operate on an existing repository under PROJECTS_ROOT, a user can lose local commits or working changes without a strong safeguard, making this a genuine tool-parameter abuse/data-destruction risk in this skill context.

Content

Scanner excerpt · scripts/github-contribution.sh (reported line 83)May include surrounding context.

sh
echo "🔄 同步你的 Fork 到官方最新状态"
git checkout main 2>/dev/null || git checkout master
git fetch upstream
git reset --hard upstream/main 2>/dev/null || git reset --hard upstream/master

# 6. 推送同步后的更改到你的 Fork
echo "📤 推送同步后的代码到你的 Fork"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The section beginning at L366 is written entirely in Chinese, while the rest of the skill is in English. This imposes a language/locale choice on users without opt-in or explanation, which matches the policy category for forced language constraints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script performs git reset --hard upstream/main (or upstream/master) without first checking for uncommitted work or requiring explicit confirmation. In an automation context this can irreversibly discard local changes in the target repository directory, especially dangerous because the script reuses an existing directory if present.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown skill content forces a specific language for all users through its natural-language instructions. Under the policy, language constraints should be optional, user-selectable, or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

All user-facing comments, prompts, and status messages in the script are in Chinese, with no option to select another language and no documented reason for the locale restriction. This can violate language or locale policy where skills should not force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.