Back to skill

Security audit

Moltcops Skill

Security checks for vulnerabilities and agentic risk

Overview

MoltCops is a local security scanner, but its own scan coverage is incomplete while it presents clean results as safe to install.

Install only if you treat MoltCops as a lightweight helper, not a final safety guarantee. A clean PASS can miss unsupported file types such as JSON, YAML, TOML, PowerShell, batch, module files, or extensionless scripts, so review the full package manually or with another scanner before trusting a skill.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/scan.py:70
Finding
Incomplete File-Type Coverage Allows Malicious Content to Evade Scanning## Vulnerability Details **File Location**: `scripts/scan.py`, lines 70-77 **Vulnerability Type**: Incomplete security scanning coverage **Risk Level**: High **Vulnerable Code**: ```python # Find files exts = {".md", ".py", ".js", ".ts", ".sh", ".jsx", ".tsx"} files = [] for root, dirs, fnames in os.walk(skill_path): dirs[:] = [d for d in dirs if d not in ("node_modules", ".git", "__pycache__")] for fn in fnames: if os.path.splitext(fn)[1] in exts: files.append(os.path.join(root, fn)) ``` ### Technical Analysis The scanner uses a narrow, case-sensitive extension allowlist to decide which files receive security analysis. It silently excludes common executable, configuration, and instruction-bearing formats, including extensionless scripts, `.json`, `.yaml`, `.yml`, `.toml`, `.mjs`, `.cjs`, `.ps1`, and `.bat`. Uppercase or mixed-case variants such as `RUN.SH` are also excluded. This is especially significant for a tool whose declared purpose is to assess untrusted Skill packages before installation. The scanner does not inspect omitted files and does not report them as skipped, yet it may still produce a `PASS` verdict. The bundled `rules.json` itself is excluded by this logic. ### Attack Path 1. An attacker creates a Skill containing malicious instructions or executable content. 2. The malicious content is placed in an unsupported file such as `payload`, `config.json`, `setup.ps1`, or `RUN.SH`. 3. A victim invokes MoltCops against the untrusted Skill directory. 4. The extension check omits the malicious file without warning. 5. No critical or high-severity rule matches are produced from the omitted content. 6. The scanner may return `PASS`, encouraging the victim to install or execute the malicious Skill. 7. The omitted payload can subsequently run through the target Skill's own installation or execution workflow. ### Impact Assessment This flaw does not directly grant the ...[truncated 564 chars]
Remediation
## Remediation Suggestions - Scan all regular files by default rather than relying on a narrow extension allowlist. - Detect binary files using content inspection and skip only files that are confidently binary. - Normalize file extensions with `.lower()` if an allowlist remains necessary. - Add support for common executable, configuration, and instruction formats, including extensionless scripts, JSON, YAML, TOML, PowerShell, batch files, and modern JavaScript module extensions. - Apply configurable file-size and traversal limits to prevent resource exhaustion when broadening coverage. - Explicitly list every skipped file and the reason it was skipped. - Do not return `PASS` when potentially relevant files were not inspected; return an incomplete-scan warning instead. - Add regression tests using malicious patterns in unsupported, extensionless, uppercase, and mixed-case filenames.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scan.py:66
Finding
Unsanitized Filenames Permit Terminal Output Manipulation## Vulnerability Details **File Location**: `scripts/scan.py`, lines 66 and 99-100 **Vulnerability Type**: Terminal escape-sequence injection **Risk Level**: Medium **Vulnerable Code**: ```python print(f"Scanning: {skill_path}") ``` ```python rel = os.path.relpath(f["file"], skill_path) print(f"{color}[{sev}]{nc} {f['rule_id']}: {f['rule_name']} ({rel}:{f['line']})") ``` ### Technical Analysis The scanner writes the user-supplied scan path and untrusted filenames directly to the terminal. On supported filesystems, filenames may contain control characters, including ANSI escape sequences. When such names are printed, a terminal can interpret the embedded bytes as control instructions rather than visible text. These instructions may change colors, reposition the cursor, clear output, create misleading hyperlinks, or visually overwrite warnings. This is terminal display manipulation rather than shell command injection: the filename is not passed to a shell and does not directly execute an operating-system command. The scanner also deliberately adds its own ANSI color sequences, but it does not distinguish those trusted sequences from control characters contained in untrusted path data. ### Attack Path 1. An attacker creates a Skill package containing a file or directory name with embedded ANSI terminal escape sequences. 2. The malicious file contains content that triggers a scanner finding, or the crafted directory is supplied as the scan target. 3. MoltCops calculates the relative filename and prints it without escaping control characters. 4. The operator's terminal interprets the embedded escape sequences. 5. The attacker-controlled display sequence hides, overwrites, recolors, or otherwise misrepresents the scanner's warning. 6. The operator may incorrectly conclude that the Skill passed or that a serious finding is harmless. ### Impact Assessment Exploitation can compromise the integrity of human-readab ...[truncated 456 chars]
Remediation
## Remediation Suggestions - Escape all control characters in user-controlled paths before writing them to a terminal. - Render paths with a safe representation such as `ascii()` or `repr()`, or replace C0, C1, DEL, and ESC characters with visible escaped forms. - Keep trusted scanner color codes separate from sanitized untrusted text. - Add a `--no-color` mode and automatically disable ANSI styling when output is not attached to an interactive terminal. - Provide structured JSON or SARIF output for automation so security decisions do not depend on terminal rendering. - Add tests containing escape characters, carriage returns, newlines, backspaces, and bidirectional text-control characters in filenames.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
| **Financial** | MC-013 | Drain patterns, unlimited withdrawals |
| **Lateral Movement** | MC-014 | Git credential access, repo manipulation |
| **Persistence** | MC-015, MC-016 | SOUL.md writes, cron job creation |
| **Autonomy Abuse** | MC-017 | Destructive force flags (rm -rf, git push --force) |
| **Infrastructure** | MC-018 | Permission escalation (sudo, chmod 777) |

## False Positive Handling
Confidence
70% 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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
| **Lateral Movement** | MC-014 | Git credential access, repo manipulation |
| **Persistence** | MC-015, MC-016 | SOUL.md writes, cron job creation |
| **Autonomy Abuse** | MC-017 | Destructive force flags (rm -rf, git push --force) |
| **Infrastructure** | MC-018 | Permission escalation (sudo, chmod 777) |

## False Positive Handling
Confidence
80% 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).

Instruction Override

High
Category
Prompt Injection
Content
[
  {"id":"MC-001","name":"System Prompt Override","category":"Prompt Injection","severity":"CRITICAL","pattern":"(ignore|disregard|forget|override|bypass).{0,20}(previous|prior|above|system|original).{0,20}(instructions|rules|prompts|guidelines)","description":"Attempts to override system instructions","confidence":0.95},
  {"id":"MC-002","name":"Jailbreak Payload","category":"Prompt Injection","severity":"CRITICAL","pattern":"(DAN.mode|developer.mode|jailbreak|do.anything.now|unlocked.mode|no.restrictions|bypass.safety)","description":"Known jailbreak patterns","confidence":0.90},
  {"id":"MC-003","name":"Tool-Use Steering","category":"Prompt Injection","severity":"CRITICAL","pattern":"(secretly\\s+(send|post|upload|execute|exfil)|silently\\s+(send|post|upload|execute)|without\\s+(telling|informing|notifying)\\s+(the\\s+)?(user|human))","description":"Hijacking agent tool usage covertly","confidence":0.92},
  {"id":"MC-004","name":"Shell Injection","category":"Code Injection","severity":"CRITICAL","pattern":"(subprocess\\.(call|run|Popen).*shell\\s*=\\s*True|os\\.system\\s*\\(|os\\.popen\\s*\\(|commands\\.getoutput)","description":"Shell injection via subprocess or os.system","confidence":0.90},
Confidence
90% confidence
Finding
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

YARA rule 'offensive_tool_references': References to well-known offensive security tools [hacktools]

High
Category
YARA Match
Content
ity":"CRITICAL","pattern":"(base64\\.(b64decode|decodebytes)|atob).*?(exec|eval|system|popen|subprocess|Function\\()","description":"Base64 decode + execute — payload obfuscation","confidence":0.95},
  {"id":"MC-007","name":"Exfiltration URL","category":"Data Exfiltration","severity":"CRITICAL","pattern":"(ngrok\\.io|ngrok-free\\.app|webhook\\.site|requestbin\\.com|hookbin\\.com|pipedream\\.net|burpcollaborator|interact\\.sh)","description":"Outbound data via webhook/tunnel URLs","confidence":0.95},
  {"id":"MC-008","name":"Env Var Key Access","category":"Data Exfiltration","severity":"MEDIUM","pattern":"(os\\.environ|os\\.getenv|process\\.env)","description":"Reading sensitive environment variables","confidence":0.70},
  {"id":"MC-009","name":"SSH Key Access","category":"Data Exfiltration","severity":"CRITICAL","pattern":"(cat|read|open|load|send|post|upload).{0,40}(id_rsa|id_ed25519|id_ecdsa|id_dsa|\\.pem|authorized_keys)","description":"Reading SSH private keys","confidence":0.90}
Confidence
70% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Credential Access

High
Category
Privilege Escalation
Content
{"id":"MC-007","name":"Exfiltration URL","category":"Data Exfiltration","severity":"CRITICAL","pattern":"(ngrok\\.io|ngrok-free\\.app|webhook\\.site|requestbin\\.com|hookbin\\.com|pipedream\\.net|burpcollaborator|interact\\.sh)","description":"Outbound data via webhook/tunnel URLs","confidence":0.95},
  {"id":"MC-008","name":"Env Var Key Access","category":"Data Exfiltration","severity":"MEDIUM","pattern":"(os\\.environ|os\\.getenv|process\\.env)","description":"Reading sensitive environment variables","confidence":0.70},
  {"id":"MC-009","name":"SSH Key Access","category":"Data Exfiltration","severity":"CRITICAL","pattern":"(cat|read|open|load|send|post|upload).{0,40}(id_rsa|id_ed25519|id_ecdsa|id_dsa|\\.pem|authorized_keys)","description":"Reading SSH private keys","confidence":0.90},
  {"id":"MC-010","name":"Credential File Access","category":"Data Exfiltration","severity":"HIGH","pattern":"(/\\.ssh/|/\\.aws/|/\\.config/.{0,20}credentials|\\.env\\b|/\\.netrc|/\\.npmrc)","description":"Accessing known credential file paths","confidence":0.85},
  {"id":"MC-011","name":"Hardcoded API Key","category":"Hardcoded Secrets","severity":"HIGH","pattern":"(sk-[a-zA-Z0-9]{20,}|AKIA[0-9A-Z]{16}|ghp_[a-zA-Z0-9]{36}|glpat-[a-zA-Z0-9_-]{20}|xox[bpsa]-[a-zA-Z0-9-]{10,})","description":"Hardcoded API keys (OpenAI, AWS, GitHub, GitLab, Slack)","confidence":0.90},
  {"id":"MC-012","name":"Private Key Material","category":"Hardcoded Secrets","severity":"CRITICAL","pattern":"(BEGIN\\s+(RSA\\s+)?PRIVATE\\s+KEY|BEGIN\\s+EC\\s+PRIVATE)","description":"Private key material in source code","confidence":0.95},
  {"id":"MC-013","name":"Drain Pattern","category":"Financial","severity":"CRITICAL","pattern":"(transfer.*all|withdraw.*unlimited|drain.*wallet|sweep.*funds|send.*entire.*balance)","description":"Cryptocurrency drain patterns","confidence":0.88},
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{"id":"MC-007","name":"Exfiltration URL","category":"Data Exfiltration","severity":"CRITICAL","pattern":"(ngrok\\.io|ngrok-free\\.app|webhook\\.site|requestbin\\.com|hookbin\\.com|pipedream\\.net|burpcollaborator|interact\\.sh)","description":"Outbound data via webhook/tunnel URLs","confidence":0.95},
  {"id":"MC-008","name":"Env Var Key Access","category":"Data Exfiltration","severity":"MEDIUM","pattern":"(os\\.environ|os\\.getenv|process\\.env)","description":"Reading sensitive environment variables","confidence":0.70},
  {"id":"MC-009","name":"SSH Key Access","category":"Data Exfiltration","severity":"CRITICAL","pattern":"(cat|read|open|load|send|post|upload).{0,40}(id_rsa|id_ed25519|id_ecdsa|id_dsa|\\.pem|authorized_keys)","description":"Reading SSH private keys","confidence":0.90},
  {"id":"MC-010","name":"Credential File Access","category":"Data Exfiltration","severity":"HIGH","pattern":"(/\\.ssh/|/\\.aws/|/\\.config/.{0,20}credentials|\\.env\\b|/\\.netrc|/\\.npmrc)","description":"Accessing known credential file paths","confidence":0.85},
  {"id":"MC-011","name":"Hardcoded API Key","category":"Hardcoded Secrets","severity":"HIGH","pattern":"(sk-[a-zA-Z0-9]{20,}|AKIA[0-9A-Z]{16}|ghp_[a-zA-Z0-9]{36}|glpat-[a-zA-Z0-9_-]{20}|xox[bpsa]-[a-zA-Z0-9-]{10,})","description":"Hardcoded API keys (OpenAI, AWS, GitHub, GitLab, Slack)","confidence":0.90},
  {"id":"MC-012","name":"Private Key Material","category":"Hardcoded Secrets","severity":"CRITICAL","pattern":"(BEGIN\\s+(RSA\\s+)?PRIVATE\\s+KEY|BEGIN\\s+EC\\s+PRIVATE)","description":"Private key material in source code","confidence":0.95},
  {"id":"MC-013","name":"Drain Pattern","category":"Financial","severity":"CRITICAL","pattern":"(transfer.*all|withdraw.*unlimited|drain.*wallet|sweep.*funds|send.*entire.*balance)","description":"Cryptocurrency drain patterns","confidence":0.88},
Confidence
80% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
| **Lateral Movement** | MC-014 | Git credential access, repo manipulation |
| **Persistence** | MC-015, MC-016 | SOUL.md writes, cron job creation |
| **Autonomy Abuse** | MC-017 | Destructive force flags (rm -rf, git push --force) |
| **Infrastructure** | MC-018 | Permission escalation (sudo, chmod 777) |

## False Positive Handling
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

No suspicious patterns detected.