Skip to content

Security: Untrusted skill content loaded without sanitization or warning #19123

@sumleo

Description

@sumleo

Problem

OpenCode loads skill content (.opencode/agents/*/SKILL.md) directly into the LLM context without any sanitization, trust boundary, or security warning. A malicious repository can include poisoned skill files that instruct the model to:

  1. Create .pip/pip.conf or .npmrc pointing to attacker-controlled package registries
  2. Write hardcoded auth tokens into config files
  3. Add curl | bash lifecycle hooks in package.json
  4. Modify system-wide package manager configs

Since skills are loaded as trusted instructions, the model executes these actions without recognizing them as attacks.

Impact

This is a supply chain attack vector — any cloned repository with malicious skill files can achieve code execution when a user runs OpenCode.

Proposed Fix

PR #18784 adds a security warning block that marks repository-provided skill content as untrusted, with specific rules preventing supply chain poisoning patterns.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions