Back to skill

Security audit

Git助手免费版

Security checks for vulnerabilities and agentic risk

Overview

This Git helper is mostly purpose-aligned, but it contains unsafe Git command examples and under-scoped execution guidance that users should review before installing.

Install only if you are comfortable reviewing commands before they run. Do not blindly execute the large-file check, avoid credential.helper store for real accounts, prefer local Git config over global changes unless intended, and back up or merge .gitignore instead of replacing it.

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
SKILL.md:261
Finding

Arbitrary Command Execution Through Crafted Git Filenames

Content
View full analysis
/dev/null | awk '$1>1048576{print $2}') ``` ### Technical Analysis The output of `git diff --cached --name-only` consists of repository-controlled filenames. Each filename is substituted directly into a command string interpreted by `sh -c`. Quoting the placeholder as `"{}"` does not make this safe. A crafted filename containing quotation marks, command substitutions, shell operators, or other metacharacters can break out of the intended argument context and introduce additional shell commands. Because `sh -c` reparses the generated string as shell syntax, the filename is treated as executable input rather than as an opaque path. The pipeline also uses newline-delimited filename processing. Git permits filenames containing spaces, tabs, newlines, quotes, and shell metacharacters, so both `git diff --name-only` and `xargs` can parse legitimate or hostile filenames incorrectly. ### Attack Path 1. An attacker creates a Git repository or contributes a change containing a file with a maliciously crafted filename. 2. The victim checks out the repository and stages the file, or receives it already present in the repository history and stages a related change. 3. The victim or AI Agent follows the documented pre-commit workflow and executes the large-file check. 4. `git diff --cached --name-only` emits the attacker-controlled filename. 5. `xargs` substitutes that filename into the command passed to `sh -c`. 6. The shell interprets injected metacharacters or substitutions and executes attacker-supplied commands. No elevated privilege is inherently acquired, but the injected command runs with all privileges and environmental access of the user or Agent executing the Skill. ### Impact Assessment Successful expl ...[truncated 688 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:400
Finding

Git Credentials Stored Unencrypted on Disk

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (14)

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The top-level description says to use the skill for broad categories like code generation, programming assistance, debugging, testing, and deployment, far beyond a narrow Git-helper role. Overbroad invocation criteria can cause the agent to select this skill in unrelated situations, exposing exec capability where it is unnecessary and increasing the risk of unintended command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The dedicated trigger section remains vague and does not give clear allow/deny criteria or concrete invocation phrases. In agent systems, ambiguous triggers can cause over-selection of a skill with exec permissions, resulting in unnecessary repository inspection or command execution in contexts that did not warrant it.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/detail.md (reported line 42)May include surrounding context.

md
cat > .gitignore << 'EOF'
node_modules/
dist/
.env
.env.local
*.log
.vscode/

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/detail.md (reported line 60)May include surrounding context.

md
cat > .gitignore << 'EOF'
node_modules/
dist/
.env
.env.local
*.log
.vscode/

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/detail.md (reported line 43)May include surrounding context.

md
node_modules/
dist/
.env
.env.local
*.log
.vscode/
.DS_Store

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% 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 · references/detail.md (reported line 116)May include surrounding context.

md
2)
        echo "撤销提交,丢弃变更..."
        read -p "确认丢弃所有变更? (y/N) " confirm
        [ "$confirm" = "y" ] && git reset --hard HEAD~1
        ;;
    3)
        echo "查找误删除的分支..."

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% 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 · references/detail.md (reported line 126)May include surrounding context.

md
2)
        echo "撤销提交,丢弃变更..."
        read -p "确认丢弃所有变更? (y/N) " confirm
        [ "$confirm" = "y" ] && git reset --hard HEAD~1
        ;;
    3)
        echo "查找误删除的分支..."

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description explicitly states '支持中文交互', presenting a language constraint in the skill's natural-language behavior without any opt-in or alternative locale choice. Under the policy, forcing a specific language without user choice is a locale-policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The functionality summary lists '中文交互' as a core capability, but does not indicate that the user can choose another language. This can be read as enforcing a specific locale preference rather than adapting to user preference.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a Git helper, but the later documentation expands its scope to generic file processing, API integration, and command execution. This mismatch can cause an agent or user to invoke the skill in broader contexts than intended, increasing the chance of unnecessary privileged tool use and unsafe task routing.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Claiming external API integration in a Git-helper skill unjustifiably broadens the apparent authority of the skill. In an agentic environment, such scope inflation can lead to misuse, accidental data disclosure to external services, or approval of tool usage that users did not expect from a local Git assistant.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The sample function writes multiple values to the user's global Git configuration with git config --global and does so immediately after collecting input, without clearly warning that the changes are persistent and affect all repositories on the machine. In an agent skill context, users may copy or run this snippet verbatim, causing unintended environment-wide changes that are difficult to notice or roll back.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The .gitignore generator uses cat > .gitignore, which blindly overwrites any existing file content. In practice this can destroy custom ignore rules and lead to accidental tracking of sensitive or bulky files if prior protections are removed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The documentation says no extra API key is needed, yet later discusses API-key handling and HTTPS external communication as though remote integrations exist. These inconsistent trust and data-flow statements create confusion about whether secrets or external network interactions may be involved, which can cause unsafe assumptions by operators or agents.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.