Back to skill

Security audit

Gitguard Skill

Security checks for vulnerabilities and agentic risk

Overview

GitGuard is mostly a coherent repo-auditing skill, but its secret scanner can follow repository symlinks and read files outside the selected repo, which weakens its local-scope safety claim.

Review before installing, especially if you might run it on untrusted repositories. Avoid scanning repos that contain symlinks unless you first inspect them, and prefer offline/local checks unless you are comfortable sending dependency names to npm/PyPI and repo identifiers to GitHub. Use a minimally scoped GitHub token if enabling authenticated GitHub triage.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
gitguard_skill/entropy.py:200
Finding

Repository Boundary Bypass Through Symbolic Links

Content
View full analysis

Vulnerability Details

File Location: gitguard_skill/entropy.py, lines 200-211
Vulnerability Type: Unrestricted symbolic-link traversal during secret scanning
Risk Level: Medium

Vulnerable Code

python
for p in root.rglob("*"):
    if scanned >= max_files:
        break
    if not p.is_file():
        continue
    if any(part in SKIP_DIR_NAMES for part in p.parts):
        continue
    if p.suffix.lower() not in SCANNABLE_EXTENSIONS and p.name != ".env":
        continue
    scanned += 1
    findings.extend(scan_file(p, entropy_threshold))
return findings

The called function reads the selected path without first rejecting symbolic links or validating the resolved target:

python
def scan_file(path: Path, entropy_threshold: float = 4.0) -> list[SecretFinding]:
    findings: list[SecretFinding] = []
    try:
        text = path.read_text(errors="ignore")
    except (UnicodeDecodeError, OSError):
        return findings

Technical Analysis

Path.is_file() follows symbolic links. Likewise, Path.read_text() reads the target of a symbolic link. The scanner recursively discovers entries beneath the supplied repository path but does not:

  • Reject symbolic links.
  • Resolve each candidate path before reading it.
  • Verify that the resolved path remains inside the resolved repository root.

Consequently, a repository can contain a symlink with a supported extension, or named .env, whose target is a file outside the repository. The scanner will treat that entry as an ordinary file and read its external target.

Although detected values are masked before being returned, a finding still contains the target path, line number, credential classification, entropy, severity, confidence, and the first and last four characters of sufficiently long matched content. This violates the documented repository boundary and can expose sensitive metadata and partial credential material.

Attack Path

  1. An attacker prepares an untrusted repo ...[truncated 1657 chars]
Remediation
View remediation

Remediation Suggestions

  1. Reject symbolic-link candidates before calling is_file() or reading content:
python
if p.is_symlink():
    continue
  1. Resolve the repository root once and enforce containment for every candidate:
python
root = Path(repo_path).resolve()

for p in root.rglob("*"):
    if p.is_symlink():
        continue

    try:
        resolved = p.resolve(strict=True)
        resolved.relative_to(root)
    except (OSError, RuntimeError, ValueError):
        continue

    if not resolved.is_file():
        continue
  1. Open only the validated resolved path and ensure no later operation reuses the unvalidated path.

  2. Return repository-relative file names rather than absolute paths:

python
display_path = str(resolved.relative_to(root))
  1. Where supported, use no-follow file-opening semantics and verify the opened file descriptor to reduce time-of-check/time-of-use race conditions.

  2. Add regression tests covering:

    • A symlink to an external .env file.
    • A symlink to an external file with a supported extension.
    • Broken and cyclic symbolic links.
    • Normal files inside the repository.
    • Paths containing nested symlinks.
  3. Apply the same canonical-path containment policy to all public methods accepting repository paths, particularly if they are exposed through an MCP or other remotely callable service.

Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Most demonstrated behavior aligns with the declared purpose: secret detection, health scoring, commit analysis, stale branch analysis, dependency checks, and multi-repo local auditing. However, the code also exposes a GitHub PR/issue triage capability that goes beyond the declared description, which only mentions optional GitHub API reads in the context of dependency freshness/local repo auditing. PR and issue triage is a distinct capability and should be explicitly declared. Therefore this is a description-behavior mismatch, though limited in scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description emphasizes local repository security/health auditing features such as entropy-based secret detection, composite scoring, commit analysis, stale branch cleanup, and dependency freshness checks. While it mentions optional GitHub API reads, this specific code’s primary function is PR and issue triage via remote GitHub API calls, including fetching open PRs/issues and labeling them stale by age. That is a materially different capability from the described local repo scanning and branch/dependency analysis. The network access itself is not necessarily inconsistent with the description’s optional GitHub API reads, but the specific behavior—issue/PR triage—is undeclared and not a supporting implementation detail for the stated functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Most of the implementation aligns with the declared purpose: local repo secret scanning, composite health analysis, commit quality checks, stale branch inspection, dependency freshness checks, and multi-repo local analysis. It also appears consistent with the 'local-first' claim while optionally using GitHub API reads. However, there are two material description/behavior mismatches. First, the code includes an extra undeclared capability: github_triage, which fetches and analyzes open GitHub pull requests and issues for staleness. This is beyond the stated scope of local repo auditing and is not mentioned in the description. Second, the description says 'stale branch cleanup,' which implies taking cleanup actions, but the implemented stale_branches method only reports branch status and recommendations; it does not perform cleanup. Therefore the description does not fully and accurately represent the actual behavior.

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 · gitguard_skill/entropy.py (reported line 69)May include surrounding context.

python
# File extensions worth scanning; skip binaries / lockfiles / minified assets.
SCANNABLE_EXTENSIONS = {
    ".py", ".js", ".ts", ".jsx", ".tsx", ".json", ".yaml", ".yml",
    ".env", ".sh", ".bash", ".toml", ".ini", ".cfg", ".php", ".rb",
    ".go", ".java", ".rs", ".html", ".md", ".txt",
}

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 · gitguard_skill/entropy.py (reported line 208)May include surrounding context.

python
# File extensions worth scanning; skip binaries / lockfiles / minified assets.
SCANNABLE_EXTENSIONS = {
    ".py", ".js", ".ts", ".jsx", ".tsx", ".json", ".yaml", ".yml",
    ".env", ".sh", ".bash", ".toml", ".ini", ".cfg", ".php", ".rb",
    ".go", ".java", ".rs", ".html", ".md", ".txt",
}

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 · gitguard_skill/github_api.py (reported line 6)May include surrounding context.

python
Only reads data the authenticated user (or public API for public repos)
already has access to. No write operations are performed by this module.
A personal access token is optional -- without one, requests fall back to
unauthenticated calls which are rate-limited by GitHub (60/hour) but work
fine for occasional checks on public repos.
"""

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises capabilities that include environment variable access, local file reads, shell/git execution, and network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. That omission weakens user and platform visibility into what the skill may invoke, increasing the risk of over-broad execution against sensitive repos, secrets in the environment, or unintended outbound requests.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · gitguard_skill/git_local.py (reported line 10)May include surrounding context.

python
def _run(repo_path: str, args: list[str]) -> str:
    try:
        result = subprocess.run(
            ["git", "-C", repo_path, *args],
            capture_output=True, text=True, timeout=30, check=False,
        )

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest advertises remote GitHub/API-backed features and points to a hosted MCP endpoint, but it does not clearly warn users what repository metadata, dependency names, branch names, PR/issue data, or other derived information may be sent off-machine. In a security-scanning skill, users may reasonably expect local-only handling, so the lack of explicit disclosure creates a privacy and data-exposure risk, especially for private repositories and internal project metadata.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · gitguard_skill/skill.py (reported line 27)May include surrounding context.

python
if isinstance(obj, dict):
        return {k: _to_dict(v) for k, v in obj.items()}
    if hasattr(obj, "__dataclass_fields__"):
        return {f: _to_dict(getattr(obj, f)) for f in obj.__dataclass_fields__}
    return obj

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency is specified as requests>=2.28.0, which allows installation of many future or currently vulnerable versions and prevents reproducible builds. In a security-scanning skill, relying on an unpinned networking library increases supply-chain and patch-state uncertainty, especially because behavior may change across environments.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.28.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

requests has multiple historical advisories, and because the manifest does not pin an exact version, there is no way to verify from this file whether deployment will use an affected release. Given this skill may optionally call the GitHub API, use of an unsafe requests version could expose network request handling weaknesses or credential leakage risks depending on the installed package.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest describes many capabilities across secrets, health, branches, dependencies, and GitHub triage, but does not specify activation boundaries, trigger phrases, or negative examples. In manifest files, this lack of specificity can lead to ambiguous invocation conditions for an agent deciding when to use the skill.

Content

No source excerpt is available for this finding.