Back to skill

Security audit

chat-learnings-extractor

Security checks for vulnerabilities and agentic risk

Overview

The skill’s chat analysis, optional remote processing, and memory writes fit its stated purpose, with endpoint settings and generated output requiring care.

Select only the exports you intend to analyze. For local processing, unset OPENAI_API_KEY and keep Ollama on loopback. For remote processing, verify the destination and provider privacy terms, and use HTTPS; avoid the remote HTTP example for private chats. Dry-run still contacts the configured model and can create directories. Review generated learnings before trusting them in persistent memory; a later run generates fresh output. The separately linked importer was not assessed.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tainted flow: 'req' from os.environ.get (line 109, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

Sending the API key as a bearer token to the intended provider is normal authentication, not inherently credential exfiltration. However, OPENAI_BASE_URL is accepted without transport or destination validation, allowing an insecure HTTP configuration to expose both the key and private conversation excerpts to network interception.

Content

Scanner excerpt · scripts/extract.py (reported line 119)May include surrounding context.

python
)

    try:
        with urllib.request.urlopen(req, timeout=120) as resp:
            result = json.loads(resp.read())
            if "choices" in result and result["choices"]:
                return result["choices"][0]["message"]["content"]

Tainted flow: 'req' from os.environ.get (line 172, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

This request does not transmit an API credential, so the scanner's credential-exfiltration characterization is overstated. Nevertheless, an unrestricted OLLAMA_BASE_URL can send private conversation excerpts over plaintext HTTP to a non-loopback server; the loopback default is safe from that particular exposure.

Content

Scanner excerpt · scripts/extract.py (reported line 179)May include surrounding context.

python
)

    try:
        with urllib.request.urlopen(req, timeout=120) as resp:
            result = json.loads(resp.read())
            return result.get("response", "")
    except Exception as e:

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/model-modes-and-categories.md (reported line 12)May include surrounding context.

bash
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1  # optional, defaults to OpenAI
python3 scripts/extract.py --dir /path/to/exports --model gpt-4o-mini

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/model-modes-and-categories.md (reported line 46)May include surrounding context.

bash
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1  # optional
python3 scripts/extract.py --dir /path/to/exports --model gpt-4o-mini

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/model-modes-and-categories.md (reported line 52)May include surrounding context.

md
**Environment Variables:**
- `OPENAI_API_KEY` — API key (required to enable this mode; if set, OpenAI mode is used instead of Ollama)
- `OPENAI_BASE_URL` — API base URL (default: `https://api.openai.com/v1`)

**Model auto-selection:**
- If `OPENAI_API_KEY` is set → defaults to `gpt-4o-mini`

Hosted-model instructions lack a privacy warning that exported conversation data will be sent to the configured API provider.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

These standalone setup instructions enable hosted processing without explicitly warning that private conversation excerpts will leave the machine. Automatic selection based on an existing API key increases the chance of unintended disclosure, although remote processing itself is an advertised feature.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/extract.py (reported line 21)May include surrounding context.

python
Environment Variables:
    OLLAMA_BASE_URL        Ollama API endpoint (default: http://127.0.0.1:11434)
    OPENAI_API_KEY         OpenAI API key (enables OpenAI-compatible mode)
    OPENAI_BASE_URL        OpenAI-compatible API base URL (default: https://api.openai.com/v1)
    OPENCLAW_WORKSPACE     Path to agent workspace (default: ~/.openclaw/workspace)
"""

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/extract.py (reported line 62)May include surrounding context.

python
def openai_extract(summary: str, model: str = "gpt-4o-mini") -> str:
    """Send prompt to OpenAI-compatible API and return extracted learnings."""
    api_key = os.environ.get("OPENAI_API_KEY")
    base_url = os.environ.get("OPENAI_BASE_URL", "https://api.openai.com/v1")
    
    if not api_key:
        print("Error: OPENAI_API_KEY not set", file=sys.stderr)

Dry-run mode creates workspace directories despite its documented no-write guarantee.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The directory creation runs before the dry-run branch, so preview mode can modify the filesystem despite its no-write description. This is a limited filesystem side effect rather than evidence of destructive writes or privilege escalation.

Content

No source excerpt is available for this finding.