Back to skill

Security audit

Opencli

Security checks for vulnerabilities and agentic risk

Overview

This skill is intended to run OpenCLI, but it delegates to mutable local or PATH-resolved executables and can operate through logged-in browser or CLI accounts, so it belongs in Review.

Install only if you trust the local OpenCLI checkout, its automatic update process, and the opencli binary on PATH. Before use, treat browser-backed commands and passthrough commands such as gh, docker, vercel, install, register, and plugin as account- or system-impacting actions that should be run only with clear user intent.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/opencli.sh:4
Finding
Execution of Unverified External and PATH-Resolved OpenCLI Programs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/opencli.sh:4-13` **Vulnerability Type**: Unverified external executable delegation and unsafe executable resolution **Risk Level**: Medium ### Vulnerable Code ```bash PROJECT_DIR="/Users/ShiXin/Documents/Workspace/github-project/opencli" SOURCE_ENTRY="$PROJECT_DIR/dist/main.js" if [[ -f "$SOURCE_ENTRY" ]]; then cd "$PROJECT_DIR" exec node "$SOURCE_ENTRY" "$@" fi if command -v opencli >/dev/null 2>&1; then exec "$(command -v opencli)" "$@" fi ``` The associated documentation in `SKILL.md:35-37` states that the external source repository is automatically synchronized with `origin/main`: ```markdown **自动同步:** 本地 source repo 由 cron job `每周二技能升级检查`(每周二 09:00)自动同步 origin/main。无需手动更新。 ``` ### Technical Analysis The wrapper delegates execution to code that is not included in the audited skill package. The preferred entrypoint, `/Users/ShiXin/Documents/Workspace/github-project/opencli/dist/main.js`, is validated only with a file-existence check. Its integrity, ownership, permissions, version, and cryptographic digest are not verified before it is executed by Node.js. The documentation further indicates that the external repository is automatically synchronized from the mutable `origin/main` branch. Consequently, the executable behavior can change after the skill has been reviewed. A compromised upstream repository, source-control account, synchronization process, or local checkout could introduce arbitrary JavaScript that the wrapper would subsequently execute. If the source entrypoint is unavailable, the wrapper executes the first `opencli` program resolved through the invoking process's `PATH`. It does not verify that this executable comes from an approved location or trusted owner. An attacker who can influence `PATH` or place an executable in an earlier searched directory could therefore substitute a malicious program. Arguments are forwarded safely as `"$@"`; the issue is not shell com ...[truncated 1963 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Package the reviewed OpenCLI implementation with the skill, or depend on a pinned, immutable release rather than a mutable external checkout. 2. Verify the executable artifact against an approved cryptographic digest or trusted digital signature before every execution. 3. Pin automatic updates to reviewed release tags or immutable commit hashes. Do not automatically place changes from `origin/main` into the trusted execution path. 4. Perform updates in a staging location, verify signatures and hashes, run security checks, and promote the artifact only after approval. 5. Remove the generic `PATH` fallback where possible. Configure an explicit absolute path to an approved OpenCLI executable. 6. If fallback behavior is required, maintain an allowlist of trusted executable paths and validate the selected file's canonical path, owner, permissions, and integrity before execution. 7. Fail closed when integrity or provenance checks cannot be completed instead of silently executing another available binary. 8. Run OpenCLI with the minimum required permissions and a sanitized environment. Limit exposure to unnecessary credentials, browser sessions, Docker sockets, and external CLI authentication material. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
- `PUBLIC` or non-browser discovery commands can still work when doctor is not green
- browser-backed adapters usually need the Browser Bridge extension and/or a logged-in browser session

## Output rules

- Prefer `-f json` for agent use
- Use `--help` before assuming argument shapes
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill explicitly directs the agent to invoke a local shell wrapper and highlights external CLI passthrough capabilities, but it does not include guardrails about requiring explicit user authorization per command, validating arguments, or warning about side effects. In an agent setting, this increases the chance of unintended command execution, especially if downstream tasks pass user-controlled arguments into powerful CLIs like docker, gh, or install/register flows.

Skill Enumeration

Medium
Category
Agent Snooping
Content
- `scripts/opencli.sh` — canonical wrapper
- `references/commands.md` — validated command cookbook
- upstream source skill: `/Users/ShiXin/Documents/Workspace/github-project/opencli/skills/opencli-usage/SKILL.md`
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.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The browser-backed examples explicitly note they may use the OpenCLI browser bridge with a logged-in browser session, but they do not include a clear user-facing warning about the privacy and account-risk implications. Running these commands could access authenticated content or perform actions in the context of the user's active session, which increases the chance of unintended data exposure or account misuse if an agent invokes them without informed consent.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
The trigger list mixes English and Chinese, including `用 opencli`, but the skill does not explain language selection or indicate that multilingual triggers are optional or user-driven. This can conflict with language/locale policy expectations when a skill hard-codes locale-specific behavior without explicit opt-in or justification.

Static analysis

No suspicious patterns detected.