opencode-session-db

Pass

Audited by Gen Agent Trust Hub on Nov 1, 2026

Risk Level: SAFECOMMAND_EXECUTIONDATA_EXFILTRATIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The scripts/query.sh script is vulnerable to SQL injection because it interpolates command-line arguments directly into SQL strings without sanitization. This occurs in the search, read, tools, stats, and export commands where the ${ARG} variable is placed directly inside query quotes. An attacker could potentially craft input to escape these quotes and execute unauthorized read-only SQL commands.
  • [DATA_EXFILTRATION]: The skill is designed to read and display the contents of ~/.local/share/opencode/opencode.db, which contains private chat history, tool outputs, and project information. While this is the declared purpose of the skill, it creates a surface for exposing sensitive user data if the agent's output is redirected to an untrusted endpoint.
  • [INDIRECT_PROMPT_INJECTION]:
  • Ingestion points: Data is retrieved from the message and part tables of the local OpenCode database via SKILL.md and scripts/query.sh.
  • Boundary markers: The skill lacks instructions or delimiters to prevent the agent from being influenced by instructions embedded in the retrieved session history.
  • Capability inventory: The skill provides access to local application data using the sqlite3 utility.
  • Sanitization: No filtering or sanitization is performed on the text retrieved from the database before it is presented to the agent.
Audit Metadata
Risk Level
SAFE
Analyzed
Nov 1, 2026, 03:47 AM