Back to skill

Security audit

Codebuddy Daily Report

Security checks for vulnerabilities and agentic risk

Overview

This daily-report skill appears intended for legitimate reporting, but it needs review because it broadly scans local repositories and imports AI session summaries.

Install only if you are comfortable letting the skill enumerate repositories across your home directory, read same-day CodeBuddy session summaries, and place that information into the agent context and stdout output. Prefer configuring narrow search paths and exclusions before use, and review generated JSON/report content before sharing it.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/collect.py:53
Finding

Overbroad Home-Directory Repository Reconnaissance

Content
View full analysis
list: """ Return search directories. Strategy: scan the ENTIRE home directory. No hardcoded guessing — we find ALL repos wherever they are, including hidden directories like .qclaw, .gongfeng-copilot, etc. """ home = get_home() dirs = [home] # Start from HOME, the script will walk into all subdirs # On Windows, also scan common non-home drive letters if SYSTEM == "Windows": for drive in ["C", "D", "E", "F"]: drive_path = Path(f"{drive}:/") if drive_path.is_dir() and drive_path != home.anchor: # Don't scan entire C:/, just common dev dirs on other drives for name in ["projects", "Projects", "code", "Code", "repos", "Repos", "work", "Work", "dev", "Dev"]: candidate = drive_path / name if candidate.is_dir(): dirs.append(candidate) return dirs ``` ```python def discover_repos(search_dirs: list, exclude_dirs: set, max_depth: int) -> list: """ Walk through search directories and find ALL git repositories, including those in hidden directories (e.g. .qclaw, .gongfeng-copilot). Cross-platform, uses os.walk instead of shell commands. """ repos = [] seen = set() # Merge user-configured excludes with global excludes all_excludes = GLOBAL_EXCLUDE_DIRS | exclude_dirs for search_dir in search_dirs: search_dir = Path(search_dir) if not search_dir.is_dir(): continue base_depth = len(search_dir.parts) for root, dirs, _files in os.walk(str(search_dir)): root_path = Path(root) ...[truncated 4564 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/collect.py:388
Finding

Unrestricted Collection of CodeBuddy Agent Session Contents

Content
View full analysis
list: """ Scan CodeBuddy's brain directory for Agent session overviews that were modified on the target date. """ sessions = [] data_dir = get_codebuddy_data_dir() # Look for brain directories brain_patterns = [ data_dir / "User" / "globalStorage" / "tencent-cloud.coding-copilot" / "brain", data_dir / "User" / "globalStorage" / "tencent-cloud.codebuddy" / "brain", ] if target_date is None: target_date = datetime.now() check_date = target_date.date() for brain_dir in brain_patterns: if not brain_dir.is_dir(): continue try: for session_dir in brain_dir.iterdir(): if not session_dir.is_dir(): continue overview_file = session_dir / "overview.md" if not overview_file.exists(): continue # Check if modified today try: mtime = datetime.fromtimestamp(overview_file.stat().st_mtime) if mtime.date() != check_date: continue content = overview_file.read_text(encoding="utf-8") if content.strip(): sessions.append({ "session_id": session_dir.name, "overview_content": content[:3000], # Limit size "modified_time": mtime.strftime("%Y-%m-%d %H:%M:%S"), }) except Exception: continue except Exception: continue # Sort by modification time sessions.sort(key=lambda s: s["modi ...[truncated 3107 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (17)

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/collect.py (reported line 107)May include surrounding context.

python
"git_author": "",
        "exclude_dirs": [
            "node_modules", "vendor", ".cache", "__pycache__",
            "venv", ".venv", "env", ".env", ".tox",
            "dist", "build", "target", "out",
        ],
        "max_depth": 5,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README advertises scanning the entire HOME directory and collecting AI Agent session overviews, but it does not clearly warn users about the breadth of filesystem discovery or the sensitivity of session-derived data. In a skill context, this can lead users to authorize collection of repository metadata and potentially sensitive work history without informed consent, increasing privacy and data-exposure risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The standalone script examples show direct execution but do not warn that running the collector will enumerate repositories and print structured results to stdout, which may be logged, piped, or captured by other tools. Because this skill is designed for automated reporting, omission of that warning makes accidental disclosure of sensitive repository names, commit history, or session summaries more likely.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to run a local Python script, read optional configuration, scan development directories, inspect git repositories across all branches, and gather agent session overviews, but it does not declare an explicit tool/permission scope. That mismatch weakens user awareness and policy enforcement, increasing the chance of unexpected local data access and shell execution beyond what a user reasonably anticipates.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger text includes broad phrases like variations of 'what did I do today/yesterday', which are common conversational requests and can cause the skill to auto-invoke unexpectedly. In this skill's context, unintended invocation is risky because execution leads to automated scanning of local repos and agent-session summaries, potentially exposing sensitive work history without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description emphasizes convenience and zero configuration but does not clearly warn users that it will automatically scan common local development directories, enumerate repositories, inspect commit history across all branches, and collect CodeBuddy session overview content. Because the collected data can reveal project names, branch names, commit messages, paths, and AI session summaries, the lack of up-front disclosure materially increases privacy and data-exposure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template’s headings and labels are entirely in Chinese, which implies the skill will generate reports in a fixed language. The policy requires avoiding forced language or locale choices unless the user is given an option or the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

All user-facing comments in this configuration file are written in Chinese, with no indication that other languages are supported or optional. Under the policy rule for natural-language violations, this is a locale/language constraint presented without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The configuration explicitly states that the script scans the entire HOME directory, including hidden directories, to discover git repositories. That is broader than the minimum access needed to generate a daily report and can expose unrelated private repositories or sensitive workspace metadata if the skill is invoked without clear user awareness of the scan scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The extra_search_dirs option allows arbitrary directories outside HOME to be scanned, which expands the skill's reach beyond the default discovery scope. If misused or preconfigured broadly, the skill could enumerate repositories from external drives, mounted volumes, or organizational paths unrelated to the user's reporting request.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The collector intentionally scans the user's entire home directory, and on Windows may inspect additional drives, to locate repositories. That access scope is much broader than necessary for a daily report and can enumerate private or unrelated projects, hidden working directories, and sensitive path information without clear minimization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code broadens collection to the entire home directory and hidden folders without making that scope obvious in the interface or requiring confirmation. This creates a privacy issue because repository names, paths, branch metadata, and activity across unrelated personal projects can be enumerated and exposed during report generation.

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

python
def detect_git_author() -> str:
    """Auto-detect the git user name from global git config."""
    try:
        result = subprocess.run(
            ["git", "config", "--global", "user.name"],
            capture_output=True, text=True, timeout=5
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The script executes git against every discovered repository under broad filesystem locations, including untrusted local repos. Even though subprocess is called safely without a shell, running git in attacker-controlled repositories can trigger risky git behaviors, hooks/config interactions, or unexpected processing of hostile repository metadata while also enabling large-scale data collection from the user's machine.

Content

Scanner excerpt · scripts/collect.py (reported line 278)May include surrounding context.

python
if author:
            cmd.append(f"--author={author}")

        result = subprocess.run(
            cmd, capture_output=True, text=True, timeout=15
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
92% confidence
Finding

This git subprocess has the same trust-boundary problem as the commit collection path: it runs git log/stat across all discovered repositories, including potentially malicious local repos. In context, the danger is less about shell injection and more about executing a complex external tool over attacker-controlled repository data while aggregating sensitive work metadata.

Content

Scanner excerpt · scripts/collect.py (reported line 354)May include surrounding context.

python
if author:
            cmd.append(f"--author={author}")

        result = subprocess.run(
            cmd, capture_output=True, text=True, timeout=15
        )

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script reads up to 3000 characters of each CodeBuddy overview.md and emits that content in JSON. Session overviews can contain sensitive prompts, code excerpts, project details, credentials pasted during troubleshooting, or other confidential material, so collecting full content rather than minimal metadata materially increases exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill silently accesses local application data and extracts CodeBuddy session text without an explicit warning or consent flow. In this skill context, that is especially dangerous because users asking for a daily report may not realize private AI session contents are being bundled into output and potentially surfaced to downstream tools or logs.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.