Back to skill

Security audit

auto-diary

Security checks for vulnerabilities and agentic risk

Overview

This auto-diary skill is mostly coherent, but it reads private workspace memory and can send diary summaries to a fixed Feishu group on a schedule without enough recipient control or privacy safeguards.

Install only if you control the listed Feishu chat and are comfortable with private workspace memory, current state, farm status, diary summaries, decisions, and next steps being retained and potentially posted there. Prefer disabling Feishu delivery until the recipient is user-configured, add a preview/redaction step, and review any cron jobs before enabling recurring runs.

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
Findings (2)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/write_diary.py:29
Finding

Persistent Workspace Content Is Embedded into Agent Prompts Without Trust Boundaries

Content
View full analysis

Vulnerability Details

File Location: scripts/write_diary.py:29-56, 61-65; scripts/weekly_review.py:74-108; scripts/monthly_review.py:88-123
Vulnerability Type: Stored prompt injection through untrusted workspace content
Risk Level: Medium

Vulnerable Code

python
def read_memory_files(yesterday_str):
    """Read memory files related to yesterday."""
    memories = []

    memory_file = MEMORY_DIR / f"{yesterday_str}.md"
    if memory_file.exists():
        memories.append(
            f"=== Yesterday Memory ({yesterday_str}) ===\n"
            f"{memory_file.read_text()}"
        )

    now_file = WORKSPACE / "NOW.md"
    if now_file.exists():
        memories.append(
            f"=== Current NOW.md ===\n{now_file.read_text()}"
        )

    if FARM_JSON.exists():
        try:
            farm_data = json.loads(FARM_JSON.read_text())
            memories.append(
                f"=== Farm Status ===\n"
                f"{json.dumps(farm_data, indent=2, ensure_ascii=False)}"
            )
        except:
            pass

    if AUTO_LEARN.exists():
        content = AUTO_LEARN.read_text()
        lines = content.split('\n')
        recent = '\n'.join(lines[-60:]) if len(lines) > 60 else content
        memories.append(
            f"=== Recent Auto-Learn ===\n{recent}"
        )

    return '\n\n'.join(memories) if memories else "No context available"

The resulting content is directly interpolated into an Agent prompt:

python
def generate_diary_context(context_data, yesterday_str):
    prompt = f"""You are a diary generation assistant. Generate a structured diary
for yesterday ({yesterday_str}) based on the following context.

## Context Data
{context_data}

## Output Requirements
Generate a diary containing the required summaries, decisions, lessons,
next actions, and system notes.
"""
    return prompt

Weekly and monthly reviews repeat the same pattern by embedding diary-derived content into prompts:

python
diar
...[truncated 2925 chars]
Remediation
View remediation

Remediation Suggestions

  1. Clearly label all loaded workspace text as untrusted reference data and explicitly instruct the Agent never to follow commands found inside it.
  2. Enclose each source in a strongly delimited data block and identify its source and trust level.
  3. Prefer structured serialization, such as a JSON object with dedicated data fields, rather than direct free-form interpolation.
  4. Apply size limits and content validation to every input file before including it in a prompt.
  5. Separate prompt construction from privileged actions. Generated text should not itself authorize tool calls or determine write destinations.
  6. Validate Agent output against a fixed schema before writing it to diary or learning files.
  7. Restrict the review Agent to the minimum required read and write paths, with external messaging disabled during generation unless separately approved.
  8. Avoid automatically re-ingesting generated text as trusted instructions. Persistent learning entries should be reviewed or filtered before reuse.
  9. Add adversarial tests in which diary and memory files contain instruction-like text, tool requests, and requests to modify persistent state.

other

Warning
Location
scripts/send_diary.py:13
Finding

Private Workspace Summaries Are Routed to a Hard-Coded Feishu Chat

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:132-137, 146-151, 189-195; scripts/send_diary.py:13-16; scripts/write_diary.py:221-274
Vulnerability Type: Privacy data disclosure through a fixed external recipient
Risk Level: Medium

Vulnerable Code

The recipient is fixed in the package:

python
# Feishu chat ID
FEISHU_CHAT_ID = "oc_15949806c791613dbf45b872e8bc111a"

DIARY_DIR = (
    Path.home()
    / ".openclaw"
    / "workspace"
    / "memory"
    / "diary"
)

The generated card contains workspace-derived summaries, decisions, and planned actions:

python
card = {
    "msg_type": "interactive",
    "card": {
        "header": {
            "title": {"tag": "plain_text", "text": title},
            "template": "blue"
        },
        "elements": [
            {
                "tag": "div",
                "text": {
                    "tag": "lark_md",
                    "content": f"**Summary**\n{zh_summary[:200]}..."
                }
            },
            {"tag": "hr"},
            {
                "tag": "div",
                "text": {
                    "tag": "lark_md",
                    "content": (
                        f"**Key Decisions**\n"
                        f"{key_decisions[:300]}"
                    )
                }
            },
            {"tag": "hr"},
            {
                "tag": "div",
                "text": {
                    "tag": "lark_md",
                    "content": (
                        f"**Next Steps**\n"
                        f"{next_steps[:200]}"
                    )
                }
            }
        ]
    }
}

The documented delivery operation sends the card to that fixed chat:

python
feishu_im_user_message(
  action="send",
  receive_id_type="chat_id",
  receive_id="oc_15949806c791613dbf45b872e8bc111a",
  msg_type="interactive",
  content=json.dumps(card)
)

Technical Analysis

The Skill reads potentially sensitive operational ...[truncated 2027 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the hard-coded chat ID and require the user to configure the destination explicitly.
  2. Keep external delivery disabled by default until the user confirms the recipient.
  3. On first use, display the full destination identifier, the type of data being sent, and a card preview.
  4. Store recipient configuration in a user-controlled configuration file or secret store rather than package source code.
  5. Validate the configured destination against an allowlist maintained by the user or administrator.
  6. Provide a local-only mode and make it the default.
  7. Redact secrets, credentials, personal data, internal identifiers, and sensitive project details before constructing a card.
  8. Minimize transmitted content. Prefer a notification that a local diary was created rather than transmitting decisions and future actions.
  9. Add an audit log recording when information was sent, what categories were included, and which configured recipient received it.
  10. Document Feishu access controls, retention expectations, and the process for revoking or changing the destination.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill advertises broad diary functionality while bundling card construction and automated dispatch behavior that can move content outside the local workspace. Even if intended for convenience, this mismatch weakens informed consent and security review because the externally visible effects are not front-and-center.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill advertises broad diary functionality while bundling card construction and automated dispatch behavior that can move content outside the local workspace. Even if intended for convenience, this mismatch weakens informed consent and security review because the externally visible effects are not front-and-center.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill advertises broad diary functionality while bundling card construction and automated dispatch behavior that can move content outside the local workspace. Even if intended for convenience, this mismatch weakens informed consent and security review because the externally visible effects are not front-and-center.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill advertises broad diary functionality while bundling card construction and automated dispatch behavior that can move content outside the local workspace. Even if intended for convenience, this mismatch weakens informed consent and security review because the externally visible effects are not front-and-center.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/monthly_review.py (reported line 124)May include surrounding context.

python
同时,提取本月最有价值的洞察(格式 A)追加到 {AUTO_LEARN}
"""
    return prompt


def build_monthly_feishu_card(month_label, diaries, review_content):

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/write_diary.py (reported line 128)May include surrounding context.

python
同时,提取本月最有价值的洞察(格式 A)追加到 {AUTO_LEARN}
"""
    return prompt


def build_monthly_feishu_card(month_label, diaries, review_content):

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
98% confidence
Finding

The function returns a prompt built from untrusted diary contents and later prints it for an agent to execute, creating a classic prompt-injection surface. A malicious diary entry can embed instructions that influence the downstream agent to exfiltrate data, alter files like auto-learn.md, or perform unintended actions because the diary text is treated as part of executable prompt context.

Content

Scanner excerpt · scripts/weekly_review.py (reported line 125)May include surrounding context.

python
同时,提取本周最有价值的洞察(格式 A)追加到 {AUTO_LEARN}
"""
    return prompt


def build_weekly_feishu_card(week_start, week_end, diaries, review_content):

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill clearly describes reading and writing local files and installing cron-driven behavior, yet it declares no explicit tool scope or permission boundary. That makes the agent's effective capabilities broader and less reviewable, increasing the chance of unintended file access or execution of shell-based side effects during automation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This skill's core value proposition depends on carrying information forward into future sessions, which creates a lasting memory trail of activities, decisions, and system state. Because the content is later reused and may also feed other automated processes, any sensitive or erroneous entry can propagate beyond its original context.

Content

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

md
---
name: auto-diary
description: "Automatically write daily/weekly/monthly diary summaries and extract insights to auto-learn.md for HexaLoop."
---

# Auto-Diary Skill

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This skill's core value proposition depends on carrying information forward into future sessions, which creates a lasting memory trail of activities, decisions, and system state. Because the content is later reused and may also feed other automated processes, any sensitive or erroneous entry can propagate beyond its original context.

Content

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

md
---
name: auto-diary
description: "Automatically write daily/weekly/monthly diary summaries and extract insights to auto-learn.md for HexaLoop."
---

# Auto-Diary Skill

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill says it will generate diary content and push a Feishu card automatically, but it does not prominently warn that diary-derived material may be transmitted to an external chat. Because diary summaries can contain sensitive personal or operational information, silent outbound sharing materially raises confidentiality risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow directs the agent to read multiple local memory and state files, synthesize them into summaries and insights, and then send output externally without any privacy filter, redaction rule, or minimization policy. This creates a direct path for sensitive information from local notes, system state, or prior sessions to be retained and disclosed beyond the local environment.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Appending extracted insights from diaries into persistent memory creates a retention pipeline for user and system information that may be reused in future contexts. Even if meant to improve continuity, this increases the blast radius of any sensitive content accidentally captured in a diary or summary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manual trigger section invites users to send simple commands that cause both filesystem writes and external message delivery, without telling them about either side effect. This makes accidental disclosure more likely because a user may treat the trigger as a harmless test command.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The delivery requirements mandate automatic posting of generated diary content to a fixed Feishu chat on completion. In context, the diary is built from memory files and system state, so automatic routine posting can expose sensitive summaries, activity patterns, or internal operational context to an external audience with no final human review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring states the script reads recent diaries, generates a monthly summary, and 'pushes a Feishu card'. However, the executable path only reads diaries, prints a prompt, and writes a local monthly review scaffold; the Feishu card helper is never invoked and there is no network call or send operation anywhere in the file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The generated prompt says the complete monthly Markdown should be saved to the monthly file and valuable insights should be appended to auto-learn.md. In reality, the script only writes a placeholder review skeleton at L190-L191 and never appends anything to auto-learn.md, so the inline instruction contradicts actual behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints a prompt containing aggregated diary summaries and key decisions to stdout, which can expose sensitive personal information in logs, terminal history, orchestration traces, or monitoring systems. Because diary content is private by nature and this skill is designed to process user memory data, this leakage is more dangerous in context than a generic debug print.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file header and user-facing card text indicate the skill is designed to operate in Chinese, and later output strings also remain Chinese-only. The policy forbids forcing a specific language without user opt-in unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The generated prompt mandates a Chinese section for one audience and an English section for another, which imposes fixed language requirements. There is no indication that the user can opt in to or change the output language, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The generated prompt says the complete weekly markdown should be saved to the weekly file and that valuable insights should be appended to auto-learn.md. In reality, this script only prints the prompt and writes a placeholder weekly file; it does not save generated review content nor append anything to auto-learn.md, so the embedded documentation about what will happen contradicts actual behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script prints a prompt that contains diary-derived summaries from the last 7 days to stdout. In agent environments, stdout is often logged, surfaced to other components, or visible to operators, so this can leak sensitive personal diary content without minimization or consent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The top-level docstring states that the script reads context, uses AI to generate a structured diary, saves it locally, and extracts insights to auto-learn.md. However, the runtime path only produces a prompt and saves a template with placeholders, and no call to extract_insights is made, so the documented behavior contradicts the actual implementation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script reads potentially sensitive local files from the user's workspace, including memory notes, NOW.md, farm.json, and auto-learn history, then aggregates them into a prompt context for downstream AI use. This creates a privacy and data-minimization risk because sensitive user content may be disclosed to an external model or other downstream consumer without clear consent, filtering, or redaction.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script combines prior memory artifacts and learning records into a new AI prompt, increasing the chance that sensitive historical context is reproduced in fresh outputs or transmitted to external AI services. Because the data is collected from multiple persistent sources and repackaged into plain-language prompts, the skill creates a practical leakage path for user-provided secrets, personal notes, or operational details.

Content

No source excerpt is available for this finding.