Back to skill

Security audit

repository-janitor

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent repository auditor, but it runs Git against configured repositories with the full inherited environment, creating a real credential and command-execution exposure if a repository's Git configuration is hostile.

Install only if you will run it under a least-privileged account with a minimal environment, against repositories whose Git configuration you trust or have hardened. Avoid scheduled or --fetch/--github/--persist operation until you are comfortable with the Git subprocess risk and have isolated credentials and network access.

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

Error
Location
scripts/audit.py:27
Finding

Repository-controlled Git configuration can execute commands with the auditor's inherited environment

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/audit.py (reported line 27)May include surrounding context.

python
remaining = self.deadline - time.monotonic()
        if remaining <= 0:
            raise Unknown("budget exhausted")
        env = dict(os.environ, GIT_OPTIONAL_LOCKS="0", GIT_TERMINAL_PROMPT="0")
        try:
            p = subprocess.run(argv, capture_output=True, env=env,
                               timeout=min(remaining, self.timeout), check=False)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill describes and instructs use of high-risk capabilities including shell execution, filesystem reads/writes, environment access, and optional networked GitHub operations, but it does not declare an explicit tool/permission scope in the metadata. Without a restrictive allowlist, an agent runtime may expose broader capabilities than intended, making accidental or unauthorized command execution, data access, or persistence more likely.

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

python
raise Unknown("budget exhausted")
        env = dict(os.environ, GIT_OPTIONAL_LOCKS="0", GIT_TERMINAL_PROMPT="0")
        try:
            p = subprocess.run(argv, capture_output=True, env=env,
                               timeout=min(remaining, self.timeout), check=False)
        except subprocess.TimeoutExpired:
            raise Unknown("timeout") from None

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

python
with tempfile.TemporaryDirectory() as d:
            p=Path(d)/"repo"; p.mkdir()
            def git(*args):
                subprocess.run(["git","-C",str(p),*args],check=True,capture_output=True)
            git("init")
            git("-c","user.name=Fixture","-c","user.email=fixture@example.invalid",
                "commit","--allow-empty","-m","fixture")

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

python
parser.add_argument("--config", type=Path, required=True)
    args=parser.parse_args()
    try:
        p=subprocess.run(["openclaw","automations","get",args.job_id],capture_output=True,text=True,timeout=15)
        if p.returncode: raise ValueError("query unavailable")
        job=json.loads(p.stdout)
        if "job" in job: job=job["job"]