T09 · Insecure Skill Coding Practices
- 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: HighVulnerable Code
bash OPENCODE_SERVER_PASSWORD=cs516123456 opencode web --hostname 0.0.0.0 --port 4096 --mdns --mdns-domain opencode.localTechnical 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
- An attacker obtains or reads the published
SKILL.md. - The attacker extracts the hardcoded password
cs516123456. - The attacker discovers the service through mDNS, network scanning, or prior knowledge of TCP port
4096. - The attacker connects to an affected server that was launched with the documented command and is reachable through one of its network interfaces.
- The attacker authenticates using the exposed password.
- Subject to the server's enabled API and process permissions, the attacker invokes available session, project, file, message, or agent-shell functionality.
- 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]
- An attacker obtains or reads the published
- Remediation
View remediation
Remediation Suggestions
- Remove the hardcoded password from
SKILL.mdand all related examples. - Immediately rotate the exposed password on every deployment that may have copied this command.
- Generate a unique, high-entropy credential for each deployment and load it from a protected secret manager or deployment-specific environment configuration.
- Never commit real credentials to documentation, source control, examples, shell history, or deployment scripts.
- Bind the server to
127.0.0.1by default. If remote access is necessary, place it behind an authenticated VPN, SSH tunnel, or properly secured reverse proxy. - Disable mDNS unless service advertisement is explicitly required in a trusted network.
- Restrict port
4096with host and network firewalls to explicitly authorized clients. - Run the server under a dedicated, unprivileged operating-system account with minimal filesystem access.
- Restrict or disable file, shell, authentication, and session-administration capabilities when they are not required.
- Add credential scanning to CI and repository hooks to prevent future plaintext-secret exposure.
- Review logs for unexpected authentication, file access, session changes, task submissions, or shell activity associated with deployments that used the exposed password.
- Remove the hardcoded password from
