Back to skill

Security audit

Connection Tracker

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local activity tracker that writes connection logs and reports as disclosed, with some privacy and input-safety caveats users should review.

Install only if you want persistent local tracking of interactions, research activity, and selected Memory events. Configure any automatic triggers and cron jobs narrowly, avoid passing untrusted text into record fields, and periodically review or delete the generated files under ~/.openclaw/workspace/connections.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
handler.js:43
Finding

Persistent Markdown Injection Through Unsanitized Connection Fields

Content
View full analysis

Vulnerability Details

File Location: handler.js, lines 43–117 and 225–241
Vulnerability Type: Persistent Markdown content injection
Risk Level: Medium

Vulnerable Code

js
function addConnection({ type, platform, action, value = 1, status = '✅' }) {
  ensureDirs();

  const now = new Date();
  const timeStr = now.toTimeString().split(' ')[0].slice(0, 5);
  const todayStr = getTodayStr();

  let stars = '⭐';
  if (value >= 3) stars = '⭐⭐⭐';
  else if (value >= 2) stars = '⭐⭐';

  let trackerContent = '';
  if (fs.existsSync(TRACKER_FILE)) {
    trackerContent = fs.readFileSync(TRACKER_FILE, 'utf-8');
  }

  const newRow = `| ${timeStr} | ${type} | ${platform} | ${action} | ${stars} | ${status} |`;

  // ...

  fs.writeFileSync(TRACKER_FILE, trackerContent);

  const dailyFile = path.join(DAILY_DIR, `${todayStr}.md`);
  appendToDaily(dailyFile, {
    time: timeStr,
    type,
    platform,
    action,
    value,
    stars,
    status
  });

  return { success: true, message: `已记录:${type}/${platform}/${action}` };
}

function appendToDaily(filePath, record) {
  let content = '';
  if (fs.existsSync(filePath)) {
    content = fs.readFileSync(filePath, 'utf-8');
  } else {
    content = `# 连接日志 ${record.time.split(':')[0]}:00\n\n`;
  }

  const line = `- [${record.time}] ${record.type}/${record.platform}: ${record.action} (${record.stars})\n`;
  content += line;

  fs.writeFileSync(filePath, content);
}

// CLI entry point
if (require.main === module) {
  const args = process.argv.slice(2);
  const command = args[0];

  if (command === 'add') {
    const params = {};
    for (let i = 1; i < args.length; i++) {
      if (args[i].startsWith('--')) {
        params[args[i].slice(2)] = args[++i];
      }
    }

    const result = addConnection({
      type: params.type || 'unknown',
      platform: params.platform || 'unknown',
   
...[truncated 2308 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate every externally supplied field before storage:

    • Require strings of bounded length.
    • Reject newline, carriage-return, null, and other control characters.
    • Define allowlists for type and status.
    • Restrict value to an explicit numeric range.
  2. Apply context-specific Markdown encoding:

    • Escape pipe characters and backslashes in table cells.
    • Encode or reject raw HTML.
    • Neutralize Markdown links and images if those constructs are not required.
    • Do not rely solely on generic HTML escaping because Markdown tables have additional delimiters.
  3. Store records in a structured format such as JSON with a strict schema, then generate Markdown from validated and escaped values. This separates data storage from presentation and reduces structural corruption.

  4. Reject missing option values rather than consuming the next flag or accepting undefined.

  5. If rendered in a browser, use a Markdown renderer configured to disable raw HTML and sanitize generated HTML and link protocols.

  6. Add tests covering pipes, multiline values, raw HTML, Markdown links, oversized input, Unicode control characters, and malformed CLI argument sequences.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 146)May include surrounding context.

md
3. 创建 `handler.js` 核心代码

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description emphasizes automatic tracking and reporting but does not prominently warn users that it creates persistent local activity logs and scheduled report archives under the workspace. Users may invoke or approve the skill without understanding that their interactions, research activity, and memory-related events will be stored over time, increasing privacy and retention risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The auto-trigger section defines multiple automatic recording and reporting behaviors using broad events like 'interaction completed' and 'Memory write completed' without clear scope, consent boundaries, deduplication rules, or source restrictions. That makes unintended invocation likely and can cause over-collection, silent persistence of activity data, and surprise scheduled writes, especially in environments where many actions or files may match these conditions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The prominent natural-language labeling and metadata are written entirely in Chinese, including the skill title and descriptive comments, with no indication that another language is supported. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation when no choice or justification is provided.

Content

No source excerpt is available for this finding.