Back to skill

Security audit

GitHub Safe Sync

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for GitHub mirror maintenance, but one cleanup command can make broad destructive repository changes if mis-scoped.

Review before installing or running write commands. Use a GitHub token limited to the target repository, run status first, use delete-backups --dry-run before deletion, avoid overriding --backup-prefix, and manually confirm force-push issues are false positives before closing them.

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/github_safe_sync.py:234
Finding

Arbitrary Backup Prefix Can Cause Broad Repository Branch Deletion

Content
View full analysis
int: token = get_token() repo_path = f"/repos/{args.owner}/{args.repo}" branches = [ item["name"] for item in paginate(f"{repo_path}/branches", token) if item["name"].startswith(args.backup_prefix) ] deleted: list[str] = [] for name in branches[: args.limit]: if args.dry_run: deleted.append(name) continue encoded = urllib.parse.quote(f"heads/{name}", safe="") api_request(f"{repo_path}/git/refs/{encoded}", token, method="DELETE") deleted.append(name) print(json.dumps({"matched_count": len(branches), "processed_count": len(deleted), "branches": deleted}, ensure_ascii=False, indent=2)) return 0 ``` ```python delete_backups = sub.add_parser("delete-backups", help="Delete backup/* branches.") delete_backups.add_argument("--owner", required=True) delete_backups.add_argument("--repo", required=True) delete_backups.add_argument("--backup-prefix", default="backup/") delete_backups.add_argument("--limit", type=int, default=1000) delete_backups.add_argument("--dry-run", action="store_true") delete_backups.set_defaults(func=cmd_delete_backups) ``` ### Technical Analysis The `delete-backups` command is documented as deleting branches under the `backup/` namespace, but the namespace is controlled by the unrestricted `--backup-prefix` argument. The code selects branches solely through: ```python item["name"].startswith(args.backup_prefix) ``` An empty string is a valid command-line value and every branch name starts with an empty string. Consequently, passing `--backup-prefix ""` causes all enumerated branches to match. An overly broad value can s ...[truncated 2211 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs use of environment secrets and networked GitHub operations but does not declare any explicit tool scope or permission boundaries. In an agent setting, this can lead to over-broad execution authority, making it easier for the skill to trigger repository mutations or access tokens in contexts where least-privilege controls should have limited it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The constant FORCE_PUSH_TITLE is a natural-language string in Chinese, and the script relies on that exact title when identifying issues. This imposes a specific language/locale assumption without offering user opt-in or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The markdown instructs that the skill closes issues whose title contains the Chinese phrase 检测到上游强制推送. This creates a language-specific behavior without user opt-in or explanation of a justified locale constraint, which can violate the language/locale policy for generally reusable skills.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.