other
- Location
scripts/opencode_sessions.py:1063- Finding
Implicitly Invocable Skill Can Read and Bulk-Export Sensitive Local Session Transcripts
- Content
View full analysis
list[MessageRecord]: require_capability(capabilities, "message") require_capability(capabilities, "part") message_rows = connection.execute( """ SELECT id, time_created, data FROM message WHERE session_id = ? ORDER BY time_created ASC, id ASC """, (session_id,), ).fetchall() messages: list[MessageRecord] = [] by_id: dict[str, MessageRecord] = {} for row in message_rows: raw = str(row["data"]) payload = safe_json_loads(raw) message = MessageRecord( id=str(row["id"]), created_ms=int(row["time_created"]), role=str((payload or {}).get("role") or "unknown"), model_id=string_or_none((payload or {}).get("modelID")), provider_id=string_or_none((payload or {}).get("providerID")), payload=payload, raw_data=raw, ) messages.append(message) by_id[message.id] = message for row in connection.execute( """ SELECT id, message_id, time_created, data FROM part WHERE session_id = ? ORDER BY message_id ASC, time_created ASC, id ASC """, (session_id,), ): message = by_id.get(str(row["message_id"])) if message is None: continue raw = str(row["data"]) payload = safe_json_loads(raw) message.parts.append( PartRecord( id=str(row["id"]), created_ms=int(row["ti ...[truncated 5754 chars]- Remediation
View remediation
