opencode-session-db
Warn
Audited by Gen Agent Trust Hub on May 19, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONDATA_EXFILTRATIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The helper script
scripts/query.shcontains several SQL injection vulnerabilities where user-supplied arguments are directly interpolated into SQL command strings without sanitization. For example, thesearchcommand usesLIKE '%${ARG}%'and theread,tools,stats, andexportcommands usem.session_id = '${ARG}'. Although the script uses the-readonlyflag withsqlite3, this vulnerability allows an attacker to manipulate the queries to extract any data from the database, bypassing intended filters.\n- [DATA_EXFILTRATION]: The skill instructions and scripts target the sensitive local file path~/.local/share/opencode/opencode.db. This database contains private user information, including full conversation histories, message metadata, and tool outputs. Accessing local application state of this nature constitutes a significant data exposure risk if the agent's actions are not strictly monitored.\n- [PROMPT_INJECTION]: The skill introduces an indirect prompt injection surface by reading and processing untrusted historical data from the local SQLite database.\n - Ingestion points: The
read,tools, andexportfunctions inscripts/query.sh, as well as the conversation retrieval queries inSKILL.md, ingest message content from themessageandparttables.\n - Boundary markers: Absent. The queries retrieve raw text content from the database and present it to the agent without instructions to ignore potential commands embedded in the history.\n
- Capability inventory: The skill allows the agent to execute shell commands (via
sqlite3andscripts/query.sh) and potentially perform follow-up actions based on the retrieved data.\n - Sanitization: Absent. The skill does not perform any validation, escaping, or filtering of the text content retrieved from the database before it is processed by the AI.
Audit Metadata