Back to skill

Security audit

Clihub Pub Full

Security checks for vulnerabilities and agentic risk

Overview

This skill has a legitimate CLI-discovery purpose, but it can broadly scan and execute local programs, persist their output for future agent use, and lacks enough safeguards around scope and registry file paths.

Install only if you are comfortable with an agent inventorying local CLI tools, executing help/version probes for programs on your PATH, and storing their help output under your home directory. Avoid system-wide or custom-directory scans unless you trust every executable in scope, and treat cached help text as untrusted data rather than instructions.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (5)

T02 · Agent Memory Poisoning

Error
Location
scripts/cli-registry.py:440
Finding

Persistent Agent Memory Poisoning Through Untrusted CLI Help Output

Content
View full analysis
80: return output ``` ```python result = { "binary": binary, "version": _fetch_version(binary), "help_raw": _clean_help_raw(text), "usage": _extract_usage(text), "summary": _extract_summary(text), "commands_text": _format_commands_text(parsed_subs), "options_text": _format_options_text(parsed_opts), "subcommands": {}, "global_options": [], } ``` ```python entry = { "name": name, "binary": binary, "description": description, "official_skill": official, "registered_at": datetime.now().isoformat(), "keywords": keywords, "auto_discovered": info, } REGISTRY_DIR.mkdir(parents=True, exist_ok=True) path = REGISTRY_DIR / "{}.json".format(name) path.write_text(json.dumps(entry, indent=2, ensure_ascii=False), encoding="utf-8") ``` The Skill explicitly instructs the Agent to trust this persisted content: ```markdown When the tool is NOT in the built-in knowledge base (no human-written description, no keywords), you MUST read its `help_raw` field — it's your only source of truth. ``` ### Technical Analysis The standard output and standard error of an arbitrary local execut ...[truncated 2162 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/cli-registry.py:794
Finding

Registry Name Path Traversal Enables Arbitrary JSON File Operations

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cli-registry.py:407
Finding

Discovery and Registration Execute Untrusted Binaries With Excessive Probe Variants

Content
View full analysis
80: return output code, out, err = _run(["man", binary], timeout=10) if len(out.strip()) > 80: return out.strip()[:16384] code, out, err = _run([binary], timeout=10) output = (out + err).strip() return output if output else "" ``` Deep discovery applies registration to executables found in every `PATH` directory: ```python if args.scan: print("\nScanning PATH for additional binaries...") seen = set(_KNOWN_BINARIES) | { e.stem for e in REGISTRY_DIR.glob("*.json") } for path_dir in os.environ.get("PATH", "").split(os. ...[truncated 3099 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:29
Finding

Unpinned Third-Party Installation Command Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:10
Finding

Overbroad Trigger Instructions Force Registry Actions for Unrelated CLI Mentions

Content
View full analysis
` via the registry script. Only after the lookup fails should you try raw `--help`.** The registry provides structured information (commands_text, options_text, keywords) that is far more useful than parsing raw help output. This skill triggers broadly — any mention of a CLI. To avoid overloading the context window, do a quick sanity check before proceeding: - Is the user asking something purely conversational? ("你好", "今天天气", ...) → skip - Is another official skill already handling this? → defer to it - Does the request involve running a tool, looking up a command, or understanding CLI output? → proceed with `lookup ` FIRST ``` ### Technical Analysis The Skill instructs the Agent to activate for any tool name and mandates a registry lookup as the first action. This is broader than the declared requirement of helping users discover or understand CLI tools. The directive increases the frequency with which persistent registry data and local executable probes enter the Agent's decision process. It does not adequately distinguish a request to execute or discover a CLI from documentation, code review, quoted text, security analysis, or purely conceptual discussion involving a CLI name. The use of absolute language such as “NEVER,” “ALWAYS,” and “FIRST action” can also interfere with normal instruction prioritization and safety review. This becomes materially dangerous when combined with untrusted registry content and unsafe executable discovery. ### Attack Path 1. A ...[truncated 987 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (22)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger condition is intentionally broad: 'any mention of a CLI' can cause the skill to activate in many unrelated conversations and then push the agent toward lookup and shell-based discovery. In this context, broad activation is especially risky because the skill also instructs runtime command execution and trust in local registry data, so an incidental mention of a tool name could escalate into unnecessary system interaction.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 76)May include surrounding context.

md
# The registry script is always at scripts/cli-registry.py relative to this SKILL.md.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Deep discovery enumerates arbitrary executables from PATH and user-specified directories, then registers them by calling the introspection pipeline that executes each binary. In an agent-skill context, this dramatically expands attack surface because any malicious executable present locally can gain code execution simply by being discovered.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly encourages users to 'scan my system and register all CLI tools you can find,' which drives broad enumeration of the local PATH and software inventory. In an agent context, that inventory can reveal sensitive operational details such as security tools, internal utilities, developer workflows, or proprietary binaries, and the README provides no warning, scoping guidance, or consent boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The design stores command metadata including descriptions, commands, options, and up to 5000 characters of raw --help output for local tools. This can leak sensitive internal tool names, environment-specific options, or proprietary operational details into local caches or agent-accessible files, especially because unknown tools are parsed automatically and cached without any documented warning or minimization.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 183)May include surrounding context.

md
│ 2. Keyword search              │  "json extract" → jq (2 hits), yq (1)
    │    → matches tool to task      │
    ├────────────────────────────────┤
    │ 3. Official skill check        │  ~/.agents/skills/jq/SKILL.md?
    │    → defer if exists           │
    ├────────────────────────────────┤
    │ 4. Registry lookup             │  jq.json: description, commands, help_raw

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly promotes automatic system-wide CLI discovery, registration, and subsequent command construction/execution with no safety warning, consent boundary, or explanation of operational risk. In an agent setting, encouraging broad enumeration and execution increases the chance of unintended command invocation, interaction with sensitive local tooling, or misuse of dangerous utilities discovered on the host.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

The documented workflow checks for ~/.agents/skills/<tool>/SKILL.md to determine whether an 'official skill' exists and then delegates handling to it. This reveals local skill-installation structure and establishes a trust/delegation mechanism based on filesystem presence, which can enable enumeration of installed skills and unsafe delegation to unverified local content if an attacker can influence skill placement or naming.

Content

Scanner excerpt · README_CN.md (reported line 181)May include surrounding context.

md
│ 2. 关键词搜索                   │  "json extract" → jq (匹配2), yq (1)
    │    → 匹配任务到工具              │
    ├────────────────────────────────┤
    │ 3. 检查官方 Skill              │  ~/.agents/skills/jq/SKILL.md?
    │    → 有则交给它                 │
    ├────────────────────────────────┤
    │ 4. 查注册表                     │  jq.json: 描述, 命令, help_raw

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill directs the agent to read environment state, inspect files under multiple home-directory paths, execute shell commands, and modify a CLI registry, but it declares no explicit tool scope or permission boundary. That makes the skill's effective capabilities broader than what a reviewer or runtime policy can easily constrain, increasing the chance of unintended command execution or persistent local changes when the skill auto-triggers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs the agent to run live commands like ' --help' and to mutate the registry via register/remove/discover flows without a user-facing warning or approval step. Even seemingly harmless help invocations can execute attacker-controlled binaries found in PATH, and registry modifications create persistent state that can influence future decisions and compound the risk across sessions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The docstring frames the tool as a lightweight JSON registry manager, but registration and discovery actually perform live binary execution and probing. This mismatch can mislead operators into invoking the tool in higher-trust contexts than they otherwise would, increasing the chance of unsafe execution of unvetted CLIs.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
90% confidence
Finding

The helper executes arbitrary binaries and arguments supplied by higher-level discovery and registration flows. Although it does not use shell=True, it still runs attacker-controlled executables directly, so a malicious binary placed on PATH or in a scanned directory will execute during metadata collection.

Content

Scanner excerpt · scripts/cli-registry.py (reported line 409)May include surrounding context.

python
def _run(cmd, timeout=10):
    try:
        r = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            universal_newlines=True, timeout=timeout
        )

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/cli-registry.py (reported line 421)May include surrounding context.

python
def _whereis(binary):
    return subprocess.call(["which", binary],
                           stdout=subprocess.DEVNULL,
                           stderr=subprocess.DEVNULL) == 0

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help extraction logic actively runs target CLIs with --help, -h, help, man, and even bare invocation. For untrusted or trojaned executables, these code paths can have side effects or execute arbitrary code immediately, so the registry is not merely reading metadata as advertised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The discover flow scans local PATH and optional directories, persists registry entries, and triggers execution-based introspection without an upfront warning or confirmation. This is dangerous because users may unintentionally inventory sensitive local tooling and execute malicious binaries during what appears to be a benign discovery step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The remove handler unlinks the target JSON file immediately when it exists. Although the command name suggests deletion, this code path lacks any confirmation prompt or explicit warning comment/docstring about the irreversible file deletion action.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

All user-facing instructional content in this file is in Chinese, and there is no indication that users can choose another language or that the locale restriction is intentional for a region-specific skill. Per the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README describes scanning the user's system and storing metadata such as tool names, versions, help output, commands, and options, but does not warn users that local environment details will be collected and cached. This can expose privacy-sensitive information about installed software, internal tooling, or environment characteristics, especially in shared or managed systems.

Content

No source excerpt is available for this finding.