Back to skill

Security audit

openclaw session viewer

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent session-viewer purpose, but it exports very sensitive session data into an unsafe local HTML/JSON artifact with documented injection and temporary-file risks.

Review before installing. Use this only for sessions you are comfortable exporting, choose a private output path, avoid sharing the generated HTML or JSON, and inspect/redact the file before opening or distributing it. The publisher should fix the HTML injection issue, avoid predictable /tmp output, use restrictive permissions, and add explicit opt-in controls for thinking, tool arguments, and tool results.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/extract_session.py:154
Finding

Stored Script Injection in Generated Session Viewer

Content
View full analysis
', '<\\/script>') ``` The serialized session data is then embedded directly into an executable script: ```python `. HTML end-tag matching is ASCII case-insensitive, however. Consequently, variants such as `` are not modified by the Python replacement but are still interpreted by the browser as the end of the surrounding script element. An attacker-controlled value in a session log can therefore terminate the data script and introduce executable HTML or JavaScript. In addition, model names, tool names, and tool-call identifiers are concatenated directly into HTML strings assigned to `innerHTML`. A malicious value containing HTML with an event handler, such as an image element with an `onerror` attribute, could execute when the affected turn is rendered. Although ordinary message bodies and tool arguments are general ...[truncated 1767 chars]
Remediation
View remediation
``` Populate that element using an HTML-safe serializer and parse its `textContent` with `JSON.parse()`. 3. Escape all characters that can affect HTML parsing, including at minimum `<`, `>`, and `&`. Do not rely on replacing only one lowercase closing tag. 4. Prefer constructing viewer elements with `document.createElement()` and assigning untrusted values through `textContent`. 5. If HTML-string construction remains necessary, call the escaping routine for every dynamic value, including: - `r.model` - `tc.name` - `tc.id` - `tr.tool_name` 6. Apply a restrictive Content Security Policy that disallows inline scripts and event handlers. Move viewer JavaScript to a separate static file if necessary. 7. Add regression tests containing mixed-case closing script tags, event-handler markup, quotes, angle brackets, and Unicode edge cases in every extracted field. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/extract_session.py:378
Finding

Sensitive Session Data Written to a Predictable Shared Temporary File

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/extract_session.py:69
Finding

Unredacted Export of Sensitive Reasoning and Tool Data

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Context Leakage

High
Category
Data Exfiltration
Confidence
95% confidence
Finding

The core purpose of the script is to extract and transform local OpenClaw session files into portable JSON/HTML, including user messages, assistant messages, tool invocations, tool results, usage metadata, and hidden 'thinking' content. In the context of agent session archives, this is a real context-leakage risk because such logs often contain credentials, proprietary prompts, command output, filesystem data, and other highly sensitive artifacts that become easier to exfiltrate once consolidated into a readable export.

Content

Scanner excerpt · scripts/extract_session.py (reported line 64)May include surrounding context.

python
return sessions_dir / f"{latest['sessionId']}.jsonl"

def extract_session(session_file):
    """Extract conversation data from session file."""
    entries = []
    with open(session_file) as f:
        for line in f:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly generates an HTML viewer containing full conversation history, raw user/assistant content, tool arguments, tool outputs, and usage statistics, but it does not warn users that highly sensitive data may be surfaced in a browsable artifact. This increases the chance of accidental disclosure through shoulder-surfing, screen sharing, saving the file in a shared location, or opening logs that contain secrets, credentials, or private reasoning/tool data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exports full session conversations, assistant responses, tool call arguments, tool results, and even captured 'thinking' fields into HTML or JSON files without any redaction, minimization, or explicit warning to the operator. Since session logs can contain prompts, secrets, file contents, command output, and other sensitive material, writing them to a browsable file in /tmp or another user-chosen path materially increases the risk of accidental disclosure, sharing, or local compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The HTML viewer hardcodes toLocaleString('zh-CN', ...), which imposes a specific locale regardless of the user's preferences. This is a natural-language/locale policy concern because the file does not offer opt-in, fallback to the user's locale, or any explanation for the restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.