Back to skill

Security audit

App Store Changelog

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward release-notes helper that reads git history and touched files, with one limited shell-quoting weakness users should be aware of.

Install only for repositories where you are comfortable letting the agent read git commit history and touched file names. Prefer passing ordinary trusted tags or commit refs, and consider fixing the script to quote and validate revision arguments before relying on it in automated release workflows.

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
scripts/collect_release_changes.sh:4
Finding

Unquoted Git Revision Range Allows Argument Injection

Content
View full analysis

Vulnerability Details

File Location: scripts/collect_release_changes.sh, lines 4-31
Vulnerability Type: Git argument injection through unquoted shell expansion
Risk Level: Medium

bash
since_ref="${1:-}"
until_ref="${2:-HEAD}"

if [[ -z "${since_ref}" ]]; then
  if git describe --tags --abbrev=0 >/dev/null 2>&1; then
    since_ref="$(git describe --tags --abbrev=0)"
  fi
fi

range=""
if [[ -n "${since_ref}" ]]; then
  range="${since_ref}..${until_ref}"
else
  range="${until_ref}"
fi

repo_root="$(git rev-parse --show-toplevel)"

printf "Repo: %s\n" "${repo_root}"
if [[ -n "${since_ref}" ]]; then
  printf "Range: %s..%s\n" "${since_ref}" "${until_ref}"
else
  printf "Range: start..%s (no tags found)\n" "${until_ref}"
fi

printf "\n== Commits ==\n"
git log --reverse --date=short --pretty=format:'%h|%ad|%s' ${range}

printf "\n\n== Files Touched ==\n"
git log --reverse --name-only --pretty=format:'--- %h %s' ${range} | sed '/^$/d'

Technical Analysis

The script accepts revision values from positional arguments and combines them into the range variable. Although the assignments are quoted, ${range} is expanded without quotes in both git log commands.

Unquoted shell expansion performs word splitting and pathname expansion. Consequently, whitespace or wildcard characters embedded in a caller-controlled revision value can turn the intended single revision expression into multiple command-line arguments. Additional tokens can then be interpreted by Git as options, path specifications, or extra revision selectors.

This is an argument-injection vulnerability rather than direct shell-command injection. The script does not use eval, and shell metacharacters introduced through parameter expansion are not reparsed as shell syntax. Therefore, the demonstrated flaw does not independently permit arbitrary shell command execution.

Attack Path

  1. An attacker or un ...[truncated 1338 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate each supplied revision before using it:

    bash
    git rev-parse --verify "${since_ref}^{commit}" >/dev/null
    git rev-parse --verify "${until_ref}^{commit}" >/dev/null
    
  2. Reject revision inputs beginning with - and inputs containing whitespace or control characters.

  3. Preserve the revision range as one quoted argument:

    bash
    if [[ -n "${since_ref}" ]]; then
      range="${since_ref}..${until_ref}"
    else
      range="${until_ref}"
    fi
    
    git log --reverse --date=short \
      --pretty=format:'%h|%ad|%s' \
      "${range}"
    
    git log --reverse --name-only \
      --pretty=format:'--- %h %s' \
      "${range}" | sed '/^$/d'
    
  4. Prefer an argument array if the command later requires optional arguments:

    bash
    git_args=(
      log
      --reverse
      --date=short
      "--pretty=format:%h|%ad|%s"
      "${range}"
    )
    git "${git_args[@]}"
    
  5. Add regression tests using revision inputs containing spaces, wildcard characters, leading hyphens, and injected Git options, and verify that such inputs are rejected rather than interpreted as additional arguments.

Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The code partially aligns with the data-collection portion of the description: it determines a git range based on the latest tag or provided refs and gathers commit history. However, its actual behavior stops at printing raw commits and touched files. It does not summarize changes, identify which are user-impacting, or generate user-facing App Store release notes. Additionally, it outputs the repository root path, which is not mentioned in the declared purpose. Because the primary delivered behavior is raw git inspection rather than release-note generation, this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.