T09 · Insecure Skill Coding Practices
- Location
index.mjs:116- Finding
Unredacted system logs and session metadata may be disclosed through an external chat channel
- Content
View full analysis
{ const lower = line.toLowerCase(); return lower.includes('error') || lower.includes('exception') || lower.includes('fail') || lower.includes('warn'); }); // Unique entries const uniqueLines = [...new Set(filteredLines)]; // Limit to last 10 const last10 = uniqueLines.slice(-10); if (last10.length > 0) { systemLogsOutput = last10.map(l => `- \`${l.trim()}\``).join('\n'); } else { systemLogsOutput = "No recent error/warning logs found in journalctl."; } } catch (error) { systemLogsOutput = `Failed to retrieve system logs: ${error.message}`; } // 2. Session Errors (Secondary) try { const sessions = await getSessions(50); // Filter logic: lastStatus != 'ok' OR abortedLastRun is true const failedSessions = sessions.filter(s => { const statusNotOk = (s.lastStatus && s.lastStatus !== 'ok'); const aborted = (s.abortedLastRun === true); return statusNotOk || aborted; }); if (failedSessions.length > 0) { sessionErrorsOutput = failedSessions.map(s => `- **${s.id}** (${s.title || 'Untitled'}): Status=${s.lastStatus || 'N/A'}, Aborted=${s.abortedLastRun || false}` ).join('\n'); } else { sessionErrorsOutput = "No recent failed sessions found."; } } catch (error) { sessionErrorsOutput = `Error checking sessions: ${error.message}`; } ``` ### Technical Analysis The Skill reads up to 100 OpenClaw gateway journal entries and returns matching warning or error lines verbatim. It performs keyword filtering but does not redact secrets or minimize t ...[truncated 2810 chars]- Remediation
View remediation
