Back to skill

Security audit

Git Commit Helper Pro

Security checks for vulnerabilities and agentic risk

Overview

This Git helper is not malicious, but it can stage every repository change and create a commit without a review or confirmation step.

Review this skill carefully before installing. Use it only in repositories where you are comfortable with a helper that may stage every changed, deleted, and untracked file before committing. Prefer manually reviewing `git status`, `git diff`, and the staged file list first, and avoid using the commit function in repositories that may contain secrets or unrelated work.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:173
Finding

Unrestricted Repository-Wide Staging May Commit Sensitive Files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 173–186
Vulnerability Type: Unrestricted staging of all repository changes
Risk Level: Medium

python
def commit(self, message: str = None) -> dict:
    """提交变更"""
    if not message:
        message = self.generate_commit_message()

    # Stage all
    self._run(["git", "add", "-A"])
    # Commit
    result = self._run(["git", "commit", "-m", message])
    return {
        "success": result["success"],
        "message": message,
        "output": result.get("stdout", ""),
    }

Technical Analysis

The commit() method executes git add -A, which stages every tracked modification, deletion, and untracked file in the repository. It does not restrict staging to files selected by the user, display the final staged set, filter likely secret files, or request confirmation before creating the commit.

The method also ignores the result of the staging command. Consequently, it proceeds to git commit even if staging failed or only partially achieved the intended state. Although commands are passed as argument lists and therefore do not exhibit shell-command injection, the repository-wide staging behavior violates least-surprise and safe-change-control principles.

Attack Path

  1. An attacker, compromised development tool, or unrelated process creates a sensitive or unintended file inside the repository, such as .env, a private key, credentials, or generated artifacts.
  2. The file remains untracked and may not be noticed by the user.
  3. The user invokes GitHelper.commit() to commit an unrelated intended change.
  4. git add -A stages the sensitive file along with all other repository changes.
  5. git commit records the staged file without requiring review or confirmation.
  6. If the resulting commit is later pushed, the sensitive content may be disclosed to everyone with access to the remote repository and may persist in Git history.

Impact Assessment

The method operates ...[truncated 627 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not stage the entire repository implicitly. Require an explicit list of files or stage only files the user has selected.
  • Show the exact staged file set and require confirmation before committing.
  • Add deny rules for common sensitive files and patterns, including .env*, private keys, credential files, tokens, and cloud configuration secrets.
  • Respect .gitignore, but do not treat it as the only secret-control mechanism.
  • Inspect staged content with secret-scanning controls before committing.
  • Check the result of git add and abort immediately if staging fails.
  • Consider committing only already-staged changes by default, leaving staging as a separate, explicit operation.
  • Return both staging and commit errors so callers can accurately determine what occurred.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The provided manifest description says only "Premium version with full implementation, examples, and enterprise support," which describes packaging/commercial tier rather than the skill's actual Git-focused functionality. This conflicts with the stated skill purpose of generating commit messages, viewing status, branch management, and diff analysis under Conventional Commits.

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 helper for commit-message generation and repository inspection, but it also performs write operations by staging all files and creating a commit. That mismatch is dangerous because a user may invoke a seemingly read-only helper and unintentionally persist sensitive, unrelated, or unreviewed changes into repository history.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The activation keywords are very broad (git, 提交, commit, 分支), increasing the chance the skill triggers during ordinary conversation about source control. In the context of a skill that can stage all files and commit changes, accidental activation materially raises the risk of unintended repository modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The commit() flow stages all files with git add -A and commits them without any warning, review, or confirmation. This is dangerous because it can capture secrets, temporary files, unrelated work, and partially complete changes, causing unintended integrity-impacting writes to version history with a single invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and surrounding instructions are presented in Chinese without indicating that language is configurable or optional. Under the stated policy, language constraints should either be justified as region-specific or offer the user a choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest/documentation states '分支管理(创建/切换/列出)', which implies active branch operations beyond inspection. In the implementation, the only branch-related method is branches(), which calls git branch --show-current and git branch -a to enumerate branches, with no code for creating or switching branches.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.