Back to skill

Security audit

opencode-client

Security checks for vulnerabilities and agentic risk

Overview

This is a legitimate OpenCode/oho command handbook, but it includes unsafe server and credential examples that could expose powerful coding-agent controls if copied as written.

Review before installing. Do not copy the server startup example as written: replace the password, bind to localhost unless remote access is intentionally secured, and avoid mDNS exposure on untrusted networks. Require explicit user confirmation before session deletion, sharing, shell execution, process killing, or sending private project files to external models.

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
SKILL.md:448
Finding

Hardcoded Password Exposes a Network-Accessible OpenCode Server

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:448
Vulnerability Type: Hardcoded credential and unsafe network exposure
Risk Level: High

Vulnerable Code

bash
OPENCODE_SERVER_PASSWORD=cs516123456 opencode web --hostname 0.0.0.0  --port 4096 --mdns --mdns-domain opencode.local

Technical Analysis

The documentation embeds a reusable plaintext password directly in a command that launches the OpenCode web server. The service binds to 0.0.0.0, making it reachable through every available network interface, and enables mDNS advertisement, which can facilitate service discovery by systems on the local network.

Because the credential is included in the distributed skill file, anyone who can read the package can obtain it. If the documented command is used without changing that password, possession of the skill becomes sufficient to know the server credential.

The documented service capabilities include project and session management, file-content access, agent task submission, and shell-command functionality. Consequently, exposure is more consequential than access to a read-only status endpoint.

Attack Path

  1. An attacker obtains or reads the published SKILL.md.
  2. The attacker extracts the hardcoded password cs516123456.
  3. The attacker discovers the service through mDNS, network scanning, or prior knowledge of TCP port 4096.
  4. The attacker connects to an affected server that was launched with the documented command and is reachable through one of its network interfaces.
  5. The attacker authenticates using the exposed password.
  6. Subject to the server's enabled API and process permissions, the attacker invokes available session, project, file, message, or agent-shell functionality.
  7. The attacker accesses project data, manipulates coding sessions, submits agent tasks, or executes available commands within the authority of the OpenCode server process.

Exploitation requires an op ...[truncated 939 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the hardcoded password from SKILL.md and all related examples.
  2. Immediately rotate the exposed password on every deployment that may have copied this command.
  3. Generate a unique, high-entropy credential for each deployment and load it from a protected secret manager or deployment-specific environment configuration.
  4. Never commit real credentials to documentation, source control, examples, shell history, or deployment scripts.
  5. Bind the server to 127.0.0.1 by default. If remote access is necessary, place it behind an authenticated VPN, SSH tunnel, or properly secured reverse proxy.
  6. Disable mDNS unless service advertisement is explicitly required in a trusted network.
  7. Restrict port 4096 with host and network firewalls to explicitly authorized clients.
  8. Run the server under a dedicated, unprivileged operating-system account with minimal filesystem access.
  9. Restrict or disable file, shell, authentication, and session-administration capabilities when they are not required.
  10. Add credential scanning to CI and repository hooks to prevent future plaintext-secret exposure.
  11. Review logs for unexpected authentication, file access, session changes, task submissions, or shell activity associated with deployments that used the exposed password.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The skill directs use of a specific external model/provider for submitting coding tasks. This can route potentially sensitive code, prompts, and repository context to an external service without documenting data handling, approval requirements, or trust constraints.

Content

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

bash
# Most common: create session + send message in one command, `directory` is the project path
oho add "Fix login bug" --title "Bug Fix" --directory /mnt/d/fe/babylon3DWorld --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply

# Another example: summarize today's progress  
oho add "Summarize today's changes" --title "Command Test" --directory /mnt/d/fe/opencode_cli --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

This example again encourages sending project-related content to a named external model/provider without any privacy or governance warnings. Repetition of the pattern increases the chance that users or agents will treat third-party routing as the default behavior.

Content

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

md
oho add "Fix login bug" --title "Bug Fix" --directory /mnt/d/fe/babylon3DWorld --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply

# Another example: summarize today's progress  
oho add "Summarize today's changes" --title "Command Test" --directory /mnt/d/fe/opencode_cli --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply

# Specify Agent
oho add "@hephaestus Fix login bug" --title "Bug Fix" --directory /mnt/d/fe/project --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Specifying both an agent and an external model/provider for a coding task compounds the risk of unauthorized code/context disclosure to third parties. In the context of a coding-assistant skill, this is more dangerous because repository contents and attached files are likely to contain proprietary or sensitive material.

Content

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

md
oho add "Summarize today's changes" --title "Command Test" --directory /mnt/d/fe/opencode_cli --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply

# Specify Agent
oho add "@hephaestus Fix login bug" --title "Bug Fix" --directory /mnt/d/fe/project --model "minimax-cn-coding-plan:MiniMax-M2.7" --no-reply
  
# Attach files
oho add "Analyze logs" --file /var/log/app.log --directory /mnt/d/fe/project --no-reply

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

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

md
| `session_delete` | Delete session |
| `session_status` | Get all session statuses |
| `message_list` | List messages in session |
| `message_add` | Send message to session |
| `config_get` | Get OpenCode configuration |
| `project_list` | List all projects |
| `project_current` | Get current project |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documents destructive deletion of sessions without warning, confirmation, or recovery guidance. In an agentic context, this can cause irreversible loss of session history, artifacts, or auditability if invoked accidentally or in response to ambiguous instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill advertises arbitrary shell command execution through the messaging interface without any safety guidance. That creates a powerful execution primitive that could be abused to modify files, run destructive commands, access sensitive data, or pivot beyond the intended task workflow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation includes direct credential and password handling (oho auth set, password examples) beyond normal session/task usage. Embedding secret-management guidance in a general-purpose skill increases the chance an agent will request, echo, store, or mishandle credentials in logs, command history, or chat transcripts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Provider credential setup is shown without caution about secret handling, increasing the risk of credential exposure through terminal history, screenshots, logs, or copied examples. In an AI-agent setting, this is especially risky because prompts and outputs may be retained or transmitted.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill’s stated purpose is task/session management via the oho CLI, but it also documents shell-based service lifecycle control, process killing, and server restart operations. This broadens the skill from a scoped client interface into host-level operational control, creating opportunities for misuse, disruption of unrelated processes, and privilege abuse if an agent follows these instructions automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The restart guidance includes force-kill commands (pkill -9, pattern-based termination) without warnings about collateral impact. Pattern-based process killing can terminate unintended processes, interrupt active work, and create denial-of-service conditions on the host.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

At L010 the handbook states that all OpenCode operations must be sent via the oho CLI. Later sections instruct the user to manage OpenCode by invoking shell utilities and scripts such as pkill, bash run.sh, ps, tail, and environment-variable-prefixed server launch commands, which contradicts the absolute wording that all operations must go through the CLI.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.