Back to skill

Security audit

Git Log Summary

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Git-report purpose, but one shipped shell wrapper can execute unintended commands from crafted options and the generated reports can expose sensitive Git metadata.

Review carefully before installing. Avoid running the remote wrapper with untrusted or user-supplied option values until the eval-based invocation is fixed, and treat generated Markdown reports as sensitive because they may include repository paths, remote URLs, author identities, branch names, and commit messages. Redact reports before sharing and use a disposable working directory for remote repository analysis.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_git_summary_remote.sh:136
Finding

Arbitrary Command Execution Through Unsafe eval Parameter Construction

Content
View full analysis
/tmp/injected-command-result #' ``` The effective command evaluated by the shell contains: ```bash ".../generate_git_summary.sh" -o "...report.md" -n 1; id > /tmp/injected-command-result # ``` ### Attack Path 1. The attacker invokes the remote repository analysis script or controls arguments supplied to it. 2. The attacker places shell syntax in `--num-commits` or constructs a quote-breaking `--output` value. 3. The script appends the untrusted value to the `PARAMS` command string. 4. Line 154 passes the c ...[truncated 961 chars]
Remediation
View remediation
1000 )); then echo "Error: --num-commits must be an integer between 1 and 1000" >&2 exit 1 fi ``` Additional hardening should include: - Check that options requiring values actually have a following argument before reading `$2`. - Use `--` when passing untrusted path values to utilities that support it. - Keep all path values in quoted array elements. - Add regression tests containing semicolons, quotes, command substitutions, spaces, and newlines in argument values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_git_summary.sh:160
Finding

Unescaped Git Metadata Enables Markdown Content Injection

Content
View full analysis
/dev/null || echo "0.00") printf "| %s | %s | %.2f%% |\n" "$author" "$count" "$percentage" fi done else # 如果没有shortlog输出,尝试从git log获取 git log --pretty=format:"%an" | sort | uniq -c | sort -nr | while read count author; do percentage=$(echo "scale=2; $count * 100 / $total_commits" | bc 2>/dev/null || echo "0.00") printf "| %s | %s | %.2f%% |\n" "$author" "$count" "$percentage" done fi } # 获取最近提交记录(Markdown表格格式) get_recent_commits() { local format="%h | %an | %ar | %s" echo "| Commit Hash | 作者 | 提交时间 | 提交日志 |" echo "|-------------|------|----------|----------|" if [ "$ALL_BRANCHES" = true ]; then git log --all --pretty=format:"| %h | %an | %ar | %s |" -n "$NUM_COMMITS" else git log --pretty=format:"| %h | %an | %ar | %s |" -n "$NUM_COMMITS" fi } ``` ### Technical Analysis Git author names and commit subjects are repository-controlled data. The script inserts these values directly into Markdown table rows without escaping Markdown delimiters, HTML, links, or other renderer-sensitive syntax. A malicious author name or commit subject containing `|` can create additional table columns or corrupt the surrounding report structure. Markdown link, image, or raw HTML syntax can also be preserved in the generated document. The exact behavior depends on the Markdown renderer: some renderers request remote image resources, ...[truncated 1316 chars]
Remediation
View remediation
` where HTML is not required. - Process fields independently instead of formatting an entire `git log` row with embedded delimiters. - Sanitize author names, commit subjects, branch names, project names, repository paths, and remote information consistently. For example, define a table-cell escaping function and call it for each field: ```bash escape_markdown_cell() { local value=$1 value=${value//$'\r'/ } value=${value//$'\n'/ } value=${value//\\/\\\\} value=${value//|/\\|} value=${value///\>} printf '%s' "$value" } ``` Use a delimiter that cannot normally occur in textual Git output, parse each field separately, and then escape it before constructing the table row. Reports should also be viewed with a Markdown renderer that disables raw HTML and automatic external-resource loading. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_git_summary.sh:109
Finding

Remote URLs Containing Credentials Are Disclosed in Generated Reports

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script builds a shell command string in PARAMS using user-controlled values such as OUTPUT_FILE and NUM_COMMITS, then executes it with eval. Even though OUTPUT_FILE is wrapped in quotes, embedded double quotes or shell metacharacters can break out of that quoting and lead to arbitrary command execution in the context of the user running the skill. In a Git-summary skill, arbitrary shell execution is unnecessary and significantly increases risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill metadata describes a local Git summary generator, but the document also advertises cloning and analyzing remote repositories. This expands the trust and attack boundary from local read-only analysis to network retrieval and filesystem writes, which can surprise users and downstream agents that rely on the metadata to assess safety.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill generates Markdown reports containing repository metadata, branch names, author information, remotes, paths, and commit history, but the documentation does not warn that these artifacts may expose sensitive internal information. Users may share or persist the report assuming it is harmless, leading to unintended disclosure of contributor identities or infrastructure details.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The remote analysis feature introduces network access by cloning arbitrary external repositories, which is a material capability increase beyond simple local reporting. Even if the intent is legitimate, this can expose systems to untrusted repositories, unexpected data transfer, and local storage of fetched content without clear justification or guardrails.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The remote repository section omits warnings that the feature clones external content and writes generated reports to local storage. Without clear notice, users may unknowingly fetch untrusted repositories and leave behind cloned data or reports containing sensitive metadata.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

All user-facing comments, help text, status messages, and report labels are presented in Chinese only. This imposes a specific language/locale without opt-in or documented justification, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help line at L060 says the output file is optional and that the default is console output. This directly contradicts main, which auto-generates OUTPUT_FILE and writes the report to disk even when the user did not request a file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The generated report includes the absolute repository path and remote repository URLs, which may embed internal hostnames, organization names, usernames, or access-token-style credentials depending on git remote configuration. In a reporting/export skill, disclosing this metadata without explicit opt-in can leak operationally sensitive information beyond the intended audience.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text documents --output as optional with a default of printing to the console, and the manifest describes generating a Markdown summary report without implying mandatory file creation. In main, however, the script always assigns a default filename when none is provided and truncates/writes that file, so console-only output never occurs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script persists a report containing commit history, author names, repository path, branch data, and potentially remote URLs to disk automatically, even when the help text suggests console output. In an agent/skill context, silent persistence increases the chance of unintended retention or later exposure of sensitive repository metadata and history.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's comments, help output, status messages, and errors are all presented only in Chinese. This imposes a locale/language choice on users without offering an alternative language or documenting that the skill is intentionally restricted to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description specifies the behavior entirely in Chinese and frames the output as a fixed format without indicating that language can be selected by the user. This can be a natural-language locale policy concern when a skill appears to force a specific language absent opt-in or justification.

Content

No source excerpt is available for this finding.