Back to skill

Security audit

Github Push

Security checks for vulnerabilities and agentic risk

Overview

This GitHub push helper is purpose-related, but it can erase local Git history and may upload sensitive files despite claiming safeguards.

Review carefully before installing. Do not run this on an existing repository or a directory containing secrets unless you have a separate backup and have manually checked what Git will stage. Do not rely on its dry-run, safe mode, or documented rate limits as security controls; use an isolated copy and inspect git status/diff before any push.

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/github_upload.py:145
Finding

Sensitive-file filtering is bypassed during Git staging and upload

Content
View full analysis

Vulnerability Details

File Location: scripts/github_upload.py:145-178, scripts/github_upload.py:233-269, and scripts/github_upload.py:282-317
Vulnerability Type: Sensitive information disclosure through ineffective file filtering
Risk Level: High

Vulnerable Code

python
def _filter_files(self, files: List[Path]) -> List[Path]:
    """Filter out excluded files"""
    result = []
    for f in files:
        rel = str(f.relative_to(self.path))
        if rel.startswith('.git/'):
            continue

        skip = False
        for pattern in self.EXCLUDE_PATTERNS:
            if pattern.endswith('/'):
                if rel.startswith(pattern.rstrip('/')):
                    skip = True
                    break
            elif pattern.startswith('*'):
                if f.name.startswith(pattern.lstrip('*')):
                    skip = True
                    break
            else:
                if pattern in rel:
                    skip = True
                    break
        if not skip:
            result.append(f)
    return result

def _get_files_to_upload(self) -> List[Path]:
    """Get list of files to upload (filtered)"""
    if not self.path.exists():
        return []
    if self.path.is_file():
        return [self.path]

    files = list(self.path.rglob('*'))
    files = [f for f in files if f.is_file()]
    return self._filter_files(files)

The filtered result is subsequently used only for reporting and an emptiness check. The actual staging operation ignores that result:

python
def _ensure_commit(self, message: str) -> bool:
    """Create commit if there are changes"""
    if self._preview_only:
        files = self._get_files_to_upload()
        print(f"[DRY RUN] Would commit {len(files)} files")
        return True

    success, output = self._run_git(['git', 'status', '--porcelain'])
    if not success:

...[truncated 3228 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace git add . with explicit staging of the validated paths:
    python
    files = self._get_files_to_upload()
    relative_files = [str(path.relative_to(self.path)) for path in files]
    self._run_git(['git', 'add', '--', *relative_files])
    
  2. Use fnmatch.fnmatch(), Path.match(), or a mature ignore-rule implementation instead of custom wildcard handling.
  3. Treat secret detection as deny-by-default. Abort the upload when a sensitive file is found rather than silently omitting it.
  4. After staging, inspect the index using git diff --cached --name-only and revalidate every staged path before committing.
  5. Scan staged content for common credential formats, private-key headers, and high-confidence secret patterns.
  6. Ensure dry-run and real execution use the same resolved staging list.
  7. Check and propagate the return value of every git add operation.
  8. Add tests proving that .env, id_rsa, server.pem, deploy.key, nested secret files, and already tracked sensitive files cannot enter the commit.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/github_upload.py:198
Finding

Existing Git repository metadata and history are deleted without confirmation

Content
View full analysis

Vulnerability Details

File Location: scripts/github_upload.py:198-206
Vulnerability Type: Destructive filesystem operation and repository history loss
Risk Level: High

Vulnerable Code

python
def _init_repo(self) -> bool:
    """Initialize git repository if needed"""
    if self._preview_only:
        print("[DRY RUN] Would initialize git repository")
        return True

    git_dir = self.path / '.git'
    if git_dir.exists():
        # v3.0: Re-initialize even if .git exists (handles source with .git)
        print("[INFO] Re-initializing git repository (detected existing .git)...")
        # Remove .git to avoid conflicts
        import shutil
        shutil.rmtree(str(git_dir))

    print("[INFO] Initializing git repository...")
    success, msg = self._run_git(['git', 'init'])

Technical Analysis

_init_repo() recursively deletes .git whenever the selected directory is already a Git repository. The deletion is unconditional during a normal upload and does not require --force, an explicit reset option, confirmation, or backup.

The .git directory contains commit history, branches, tags, remotes, reflogs, local configuration, index state, worktree metadata, and hooks. Deleting it converts an existing repository into an unrelated newly initialized repository. This exceeds the minimum filesystem mutation needed to push a repository to GitHub: existing repositories should be reused rather than destroyed.

The risk is amplified when the resulting replacement history is subsequently pushed with the supported --force option.

Attack Path

  1. A user or automation agent selects an existing local Git repository as --path.
  2. The upload workflow calls _init_repo().
  3. The script detects .git and recursively deletes it with shutil.rmtree().
  4. The script initializes a new repository and creates a new commit from the current working tree.
  5. Local branches, ...[truncated 739 chars]
Remediation
View remediation

Remediation Suggestions

  1. Never remove an existing .git directory during an ordinary upload.
  2. Run git init only when .git is absent:
    python
    if not (self.path / '.git').exists():
        success, msg = self._run_git(['git', 'init'])
    
  3. Reuse existing repository configuration and update the remote only after showing the current and proposed URLs.
  4. If repository replacement is genuinely required, expose it through a separate, clearly named option and require interactive confirmation.
  5. Before any destructive reset, create a verified backup of .git outside the repository and provide restoration instructions.
  6. Refuse destructive operations in unattended mode unless a narrowly scoped explicit authorization flag is supplied.
  7. Prefer git push --force-with-lease over git push -f to avoid overwriting remote changes that were not previously observed.
  8. Add integration tests confirming that existing commits, branches, tags, remotes, and reflogs remain intact after a normal upload.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/github_upload.py:39
Finding

Documented rate limits, cooldowns, delays, and safe mode are not enforced

Content
View full analysis

Vulnerability Details

File Location: scripts/github_upload.py:39-44, scripts/github_upload.py:58-73, and scripts/github_upload.py:479-485
Vulnerability Type: Nonfunctional security controls and misleading safe-mode configuration
Risk Level: Medium

Vulnerable Code

python
# Safety thresholds
MAX_COMMITS_PER_HOUR = 100
MAX_PUSHES_PER_HOUR = 50
MIN_PUSH_COOLDOWN = 180
DEFAULT_DELAY_MIN = 2
DEFAULT_DELAY_MAX = 4

The corresponding values are stored but not enforced:

python
def __init__(
    self,
    repo: str,
    path: str,
    safe: bool = True,
    min_delay: float = None,
    max_delay: float = None,
    preview_only: bool = False,
    force: bool = False
):
    self.repo = repo
    self.path = Path(path).resolve()
    self.safe = safe
    self.min_delay = min_delay if min_delay else self.DEFAULT_DELAY_MIN
    self.max_delay = max_delay if max_delay else self.DEFAULT_DELAY_MAX
    self._preview_only = preview_only
    self.force = force

The command-line interface presents these values as active controls:

python
parser.add_argument('--safe', action='store_true', default=True,
                    help='Enable safety features')
parser.add_argument('--no-safe', action='store_true',
                    help='Disable safety features')
parser.add_argument('--dry-run', action='store_true',
                    help='Test without pushing')
parser.add_argument('--force', action='store_true',
                    help='Force push if needed')
parser.add_argument('--delay', '-d', type=float, default=None,
                    help='Delay between operations')

Technical Analysis

The class defines maximum commits per hour, maximum pushes per hour, a minimum push cooldown, and randomized delay values. It also accepts a safe-mode flag. In the audited implementation, these fields are not consulted before committing or pushing, and no ` ...[truncated 1521 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce MIN_PUSH_COOLDOWN before every push.
  2. Persist timestamps and operation counters in a user-specific state file protected against symlink attacks and concurrent updates.
  3. Reject operations exceeding MAX_PUSHES_PER_HOUR or MAX_COMMITS_PER_HOUR.
  4. Apply the configured delay with a validated, bounded sleep interval.
  5. Make safe=True activate all validation, throttling, sensitive-file checks, and destructive-operation protections.
  6. Remove --safe, --no-safe, and --delay if the controls are not implemented.
  7. Ensure dry-run reports the exact controls and limits that would be applied during real execution.
  8. Add unit and integration tests covering cooldown enforcement, hourly limits, concurrent invocations, invalid delay values, and safe-mode behavior.
  9. Revise the documentation so it does not claim protections that are absent from the implementation.
Vulnerability Patterns
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (39)

Self-Modification

High
Category
Rogue Agent
Confidence
95% confidence
Finding

Documenting a '--no-safe' option that disables safety features creates a direct bypass for whatever file filtering and guardrails the tool relies on. In a push-automation skill, that can enable accidental publication of secrets, unsafe files, or destructive repository actions with reduced friction.

Content

Scanner excerpt · README.md (reported line 125)May include surrounding context.

md
- **"SSH key not loaded"**: Manually run `ssh-add ~/.ssh/id_ed25519` if auto-loading fails

### Advanced Options
- `--no-safe`: Disable safety features for maximum speed (use with caution)
- `--delay N`: Set custom delay between operations (seconds)
- `--config PATH`: Use custom configuration file

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
96% confidence
Finding

The '--no-safe' parameter is a high-risk control because it invites users or downstream agents to suppress protective behavior in an automation context. Given this skill's stated purpose of automatically configuring and pushing content, an exposed safety-bypass flag significantly raises the risk of repository compromise, secret leakage, or unintended destructive operations.

Content

Scanner excerpt · README.md (reported line 125)May include surrounding context.

md
- **"SSH key not loaded"**: Manually run `ssh-add ~/.ssh/id_ed25519` if auto-loading fails

### Advanced Options
- `--no-safe`: Disable safety features for maximum speed (use with caution)
- `--delay N`: Set custom delay between operations (seconds)
- `--config PATH`: Use custom configuration file

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description omits or downplays destructive behaviors such as deleting an existing .git directory, reinitializing a repository, changing git config, auto-committing, and force-pushing. In a repository-management context, undisclosed history-rewriting or repo-reset actions can cause data loss, overwrite provenance, and push unintended contents to remote origin.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description omits or downplays destructive behaviors such as deleting an existing .git directory, reinitializing a repository, changing git config, auto-committing, and force-pushing. In a repository-management context, undisclosed history-rewriting or repo-reset actions can cause data loss, overwrite provenance, and push unintended contents to remote origin.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation mentions automatic conflict resolution with pull + rebase + force but does not clearly warn that these actions can rewrite commit history and overwrite remote changes. In the context of Git automation, insufficient warning is especially dangerous because users may treat the skill as safe-by-default while it performs irreversible repository mutations.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 66)May include surrounding context.

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 69)May include surrounding context.

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 122)May include surrounding context.

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

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

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/anti-patterns.md (reported line 85)May include surrounding context.

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/api.md (reported line 32)May include surrounding context.

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · references/api.md (reported line 32)May include surrounding context.

md
### Auto SSH Config

Auto-detects `~/.ssh/id_rsa` or `~/.ssh/id_ed25519`

### Auto Remote Config

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation claims the tool will auto-initialize if .git exists, but the implementation actually removes .git entirely and rebuilds it. This mismatch is security-relevant because it misleads operators and agents about destructive behavior, increasing the chance of accidental data loss and unsafe execution.

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 · scripts/github_upload.py (reported line 50)May include surrounding context.

python
EXCLUDE_PATTERNS = [
        '.git/', '.gitignore', '__pycache__/', '*.pyc',
        '.DS_Store', 'Thumbs.db', '.internal', '.DS_Store',
        '.env', '.env.local', '.env.*.local',
        'id_rsa', 'id_ed25519', 'id_rsa.pub', 'id_ed25519.pub',
        '*.pem', '*.key', 'secrets.yaml', '*.secret',
        'config.json', 'secrets.json',

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 · scripts/github_upload.py (reported line 50)May include surrounding context.

python
EXCLUDE_PATTERNS = [
        '.git/', '.gitignore', '__pycache__/', '*.pyc',
        '.DS_Store', 'Thumbs.db', '.internal', '.DS_Store',
        '.env', '.env.local', '.env.*.local',
        'id_rsa', 'id_ed25519', 'id_rsa.pub', 'id_ed25519.pub',
        '*.pem', '*.key', 'secrets.yaml', '*.secret',
        'config.json', 'secrets.json',

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/github_upload.py (reported line 52)May include surrounding context.

python
'.DS_Store', 'Thumbs.db', '.internal', '.DS_Store',
        '.env', '.env.local', '.env.*.local',
        'id_rsa', 'id_ed25519', 'id_rsa.pub', 'id_ed25519.pub',
        '*.pem', '*.key', 'secrets.yaml', '*.secret',
        'config.json', 'secrets.json',
        '*.zip', '*.tar', '*.tar.gz', '*.dmg', '*.exe', '*.dll', '*.so', '*.dylib'
    ]

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/github_upload.py (reported line 53)May include surrounding context.

python
'.env', '.env.local', '.env.*.local',
        'id_rsa', 'id_ed25519', 'id_rsa.pub', 'id_ed25519.pub',
        '*.pem', '*.key', 'secrets.yaml', '*.secret',
        'config.json', 'secrets.json',
        '*.zip', '*.tar', '*.tar.gz', '*.dmg', '*.exe', '*.dll', '*.so', '*.dylib'
    ]

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The tool deletes any existing .git directory and reinitializes the repository before pushing, which destroys commit history, branch metadata, hooks, remotes, and forensic provenance. In a push automation skill, this is especially dangerous because it silently rewrites repository state while presenting itself as a safe upload helper.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Automatically deleting an existing .git directory without confirmation is a destructive action that can irreversibly erase repository metadata and history. Because this skill is designed for autonomous use, lack of a confirmation gate makes accidental damage substantially more likely.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/github_upload.py (reported line 481)May include surrounding context.

python
parser.add_argument('--path', required=True, help='Local path to upload')
    parser.add_argument('--message', '-m', default=None, help='Commit message')
    parser.add_argument('--safe', action='store_true', default=True, help='Enable safety features')
    parser.add_argument('--no-safe', action='store_true', help='Disable safety features')
    parser.add_argument('--dry-run', action='store_true', help='Test without pushing')
    parser.add_argument('--force', action='store_true', help='Force push if needed')
    parser.add_argument('--delay', '-d', type=float, default=None, help='Delay between operations')

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · scripts/github_upload.py (reported line 481)May include surrounding context.

python
parser.add_argument('--path', required=True, help='Local path to upload')
    parser.add_argument('--message', '-m', default=None, help='Commit message')
    parser.add_argument('--safe', action='store_true', default=True, help='Enable safety features')
    parser.add_argument('--no-safe', action='store_true', help='Disable safety features')
    parser.add_argument('--dry-run', action='store_true', help='Test without pushing')
    parser.add_argument('--force', action='store_true', help='Force push if needed')
    parser.add_argument('--delay', '-d', type=float, default=None, help='Delay between operations')

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly promotes a force-push workflow with 'intelligent conflict resolution' but does not clearly warn that force-push can overwrite remote history and permanently discard collaborators' commits. In an automation-oriented skill, normalizing force-push as a routine conflict-handling step materially increases the chance of destructive misuse.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises shell-driven Git/GitHub automation but declares no explicit tool scope or allowed-tools boundary. In an agent environment, that omission can let the skill be invoked with broader-than-expected shell access, increasing the chance of unintended command execution or misuse of local system state.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Broad trigger phrases such as general requests about git push or conflict handling can cause the skill to be auto-invoked in situations where the user did not intend repository-modifying automation. Because this skill can perform sensitive shell-backed Git operations, overbroad activation materially raises the risk of accidental destructive actions.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/anti-patterns.md (reported line 47)May include surrounding context.

4. Unverified Large Batches

bash
# ❌ Wrong: Push without verification
python scripts/github_upload.py --repo o/r --path ./large-dir --force