Back to skill

Security audit

Weibo Publisher

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a Weibo posting helper, but it gives agents high-impact social-posting authority with weak confirmation boundaries, local plaintext state tracking, and some unsafe automation guidance.

Review this skill carefully before installing. Use it only when you want an agent to publish to a real Weibo account, require confirmation before every send action, avoid unattended/hourly posting, and do not rely on the optional Python script as proof that anything was actually posted. Treat saved snapshots and weibo-state.json as potentially sensitive because they can contain account or post content.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/post_weibo.py:91
Finding
False Publication Success Corrupts Persistent Posting State## Vulnerability Details **File Location**: `scripts/post_weibo.py`, lines 91–115 and 173–178 **Vulnerability Type**: False success reporting and unverified persistent state mutation **Risk Level**: Medium **Vulnerable Code**: ```python def post_to_weibo(content, use_quick_post=False): """ Post content to Weibo using browser automation. This is a reference implementation showing the workflow. In practice, you would use OpenClaw's browser tool directly. Args: content: Text content to post use_quick_post: Use quick post popup instead of main textbox Returns: bool: True if successful, False otherwise """ print(f"📝 Posting to Weibo...") print(f"Content: {content[:50]}{'...' if len(content) > 50 else ''}") print(f"Length: {len(content)} characters") # This is pseudocode - actual implementation uses OpenClaw browser tool steps = [ f"1. Open {WEIBO_URL}", "2. Take snapshot to get element refs", "3. Click textbox", "4. Type content", "5. Click send button", "6. Verify post appeared" ] print("\nSteps:") for step in steps: print(f" {step}") print("\n✅ Post workflow defined. Use OpenClaw browser tool to execute.") return True ``` ```python success = post_to_weibo(content, use_quick_post=args.quick) if success: write_state(content) print("\n✅ Success! State updated.") return 0 else: print("\n❌ Failed to post.") return 1 ``` ### Technical Analysis `post_to_weibo()` is explicitly a pseudocode implementation and performs no browser automation or network request. Nevertheless, it unconditionally returns `True`. The caller interprets this value as proof that publication succeeded, calls `write_state(content)`, prints a success message, a ...[truncated 2140 chars]
Remediation
## Remediation Suggestions 1. Do not return success from a pseudocode or unimplemented publication function. Raise `NotImplementedError` or return `False`. 2. Do not call `write_state()` unless publication has been positively verified through browser output or a confirmed Weibo response. 3. Separate workflow generation from execution. A documentation-only mode should use a distinct command and must not mutate state. 4. Return a structured result containing publication status, verification evidence, and any remote post identifier. 5. Commit state only after checking that the new post appears on the authenticated profile with matching content. 6. Write state atomically using a temporary file and replacement to avoid partial records. 7. Add tests asserting that failed, skipped, simulated, and unverified publication attempts never update the state file. 8. Consider storing only the minimum required metadata, such as a timestamp and content hash, rather than complete post content. A safe interim implementation would be: ```python def post_to_weibo(content, use_quick_post=False): raise NotImplementedError( "Browser publication is not implemented by this standalone script" ) ```

T05 · Unauthorized Access and Privilege Escalation

Note
Location
references/TROUBLESHOOTING.md:209
Finding
Overbroad Browser Process Termination in Recovery Guidance## Vulnerability Details **File Location**: `references/TROUBLESHOOTING.md`, lines 209–217 **Vulnerability Type**: Overbroad process termination and violation of least privilege **Risk Level**: Low **Vulnerable Code**: ```markdown **If browser crashed**: ```javascript // Restart browser browser(action="stop", profile="openclaw") browser(action="start", profile="openclaw") ``` **If browser is frozen**: ```bash # Kill and restart pkill -f "Chrome.*openclaw" # Then start again via browser tool ``` ``` ### Technical Analysis The recovery instructions recommend `pkill -f "Chrome.*openclaw"`. The `-f` option matches against complete process command lines, and `pkill` terminates every process visible to the invoking user that matches the expression. The command is not restricted to the browser process associated with the failed posting operation. Although the preceding managed-browser stop action is appropriately scoped by profile, the fallback command bypasses that control boundary. It may terminate other Chrome processes, tabs, managed-browser sessions, or concurrent automation that happen to include both `Chrome` and `openclaw` in their command lines. The instruction does not obtain permissions beyond those already held by the invoking user, but it encourages an operation broader than the task requires. If executed by an Agent with process-control capability, unrelated workloads within that user's session may be disrupted. ### Attack Path 1. A Weibo browser action stalls or appears unresponsive. 2. The user or Agent follows the documented frozen-browser recovery procedure. 3. The Agent executes `pkill -f "Chrome.*openclaw"`. 4. The operating system finds every user-accessible process whose complete command line matches the expression. 5. All matching processes are terminated rather than only the failed managed-browser instance. 6. Unrelated browser sessions or concurrent OpenClaw tasks lose their pro ...[truncated 767 chars]
Remediation
## Remediation Suggestions 1. Remove the broad `pkill -f` instruction. 2. Prefer the managed and profile-scoped operation: ```javascript browser(action="stop", profile="openclaw") browser(action="start", profile="openclaw") ``` 3. If direct process termination is unavoidable, obtain the exact PID associated with the affected managed-browser instance and validate its executable path and profile directory before signaling it. 4. Use a graceful termination signal first and reserve forced termination for a confirmed nonresponsive process. 5. Require explicit user confirmation before terminating any process outside the browser management API. 6. Warn that process termination may discard unsaved browser work. 7. Ensure recovery logic targets a uniquely identified session rather than matching a general command-line pattern.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The manifest says the skill publishes to Weibo, but the documentation also adds undeclared local persistence and operational behavior such as rate limiting and state tracking. This mismatch is dangerous because reviewers and users may authorize the skill for one purpose while it quietly performs additional actions, reducing transparency and increasing the chance of unauthorized side effects.

Context Leakage

High
Category
Data Exfiltration
Content
If issues persist:

1. **Capture full context**:
   - Take snapshot and save output
   - Note exact error messages
   - Record steps to reproduce
Confidence
84% confidence
Finding
The instruction to 'capture full context' and save snapshots, exact errors, and reproduction steps can expose sensitive data from a logged-in Weibo session, including account identifiers, post content drafts, and potentially other visible page data. In a browser-automation skill, indiscriminate collection and retention of snapshots increases the likelihood of leaking user content or session-related information into logs and memory files.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The quick-reference provides copy-paste steps to publish a public Weibo post and later update a local state file, but it does not warn that the action is externally visible and modifies local data. In an automation skill, omission of these safety cues increases the chance of accidental public posting or unintended persistence, especially when operators follow the template mechanically.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill documentation instructs the agent to read and write a local state file but does not declare any tool scope or permissions boundary. Undeclared file capabilities make the skill less auditable and can enable unintended persistence or misuse of local storage beyond what a user would expect from a simple social-posting skill.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The manifest description says to use the skill when the user wants to "post content to Weibo, share updates on Weibo, publish microblogs, or automate Weibo posting." These triggers are broad and do not define clear boundaries or exclusions, which could cause unintended invocation for general discussion or planning about Weibo rather than actual publishing.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill is designed to make external, potentially irreversible changes by posting to a social-media account and updating local state, yet it does not require a clear user-facing warning or confirmation. In this context, accidental activation could cause unauthorized public posts, reputational harm, or leakage of sensitive content through the managed browser session.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The examples explicitly document autonomous hourly posting and state-driven re-post logic, which expands the skill from user-initiated publishing into unattended social-media automation. In a browser-automation skill tied to a real account, this can cause unwanted posts, account abuse, spam, and policy violations without a fresh user request each time.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The examples combine automated posting with persistent local state tracking, yet do not warn about account impact, repeated posting, storage of prior content, or the consequences of running against a logged-in browser profile. This omission makes it easier for users or downstream agents to trigger spammy or unintended account activity and silently retain posting history on disk.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The documented 'generate content based on trending topics' workflow gives the skill a content-creation function beyond simple transport/publishing of user-provided text. That increases the risk of deceptive autonomy, accidental misinformation, or reputation harm because the system may synthesize and publish content the user did not directly author or approve.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The troubleshooting guide introduces shell-level process inspection and termination commands (`ps`, `pkill`) that are broader than the stated browser-automation purpose. Even though framed as recovery steps, these commands expand the operational scope from posting to host process management and could kill unrelated Chrome processes or encourage unsafe command execution in environments where the agent should not have shell access.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation includes destructive process-kill commands without cautions, confirmation steps, or tight scoping. In practice, `pkill -f "Chrome.*openclaw"` can terminate active browser sessions and potentially disrupt unrelated work, making the recovery guidance operationally unsafe.

Natural-Language Policy Violations

Medium
Confidence
82% confidence
Finding
The file states 'Always use Unicode escape for Chinese content' and presents this as mandatory handling for Chinese text. This is a natural-language locale/language-specific requirement rather than an optional or justified regional constraint, so it reads as a policy that treats one language differently without offering user choice or clear necessity.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The guide gives technically incorrect guidance by claiming Chinese quotation marks inherently break JSON parsing, when the shown issue is more consistent with malformed serialization or incorrect request construction. This kind of misleading troubleshooting advice can cause implementers to transform user content unnecessarily, obscure the real bug, and build brittle or unsafe handling logic around untrusted text.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The file provides a complete end-to-end workflow that clicks the compose box, types content, and presses the send button on a live Weibo account without an explicit warning or confirmation boundary. In a social-publishing skill, this is significant because it increases the risk of accidental real-world posting, misuse of an authenticated browser profile, and unintended actions on behalf of the user.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The documentation instructs use of a generic shell-execution capability (`exec(command="sleep ...")`) in a skill whose stated purpose is browser-based Weibo posting. Even though the example only sleeps, normalizing `exec` in the workflow expands the operational scope of the skill and can encourage downstream agents or maintainers to rely on unnecessary command execution, increasing the chance of abuse or unsafe command composition.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The script advertises publishing to Weibo but `post_to_weibo()` only prints a pseudocode workflow and always returns success without performing any browser automation or verifying that a post occurred. In a skill intended to automate real posting, this is dangerous because downstream agents or users may believe content was published when it was not, causing integrity issues, false audit state, and unsafe automation decisions based on a fake success result.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The docstring and comments describe a real posting implementation, but the code explicitly states it is pseudocode and does not execute posting. This mismatch increases the risk that operators, agents, or other code will trust the interface and treat it as a real side-effecting publisher, especially since the script updates state as if publication succeeded.

Description-Behavior Mismatch

Low
Confidence
89% confidence
Finding
The manifest describes the skill as publishing posts to Weibo via browser automation, with emphasis on text posting features such as emoji, hashtags, and mentions. The documented 'Workflow 3: Scheduled Post' adds deferred/scheduled publishing behavior, which is a materially broader capability than immediate posting and is not mentioned in the manifest.

Description-Behavior Mismatch

Low
Confidence
84% confidence
Finding
The documentation introduces local state tracking in a memory file without reflecting that persistence in the manifest's stated purpose. Hidden or under-disclosed state storage is risky because it can retain sensitive post history and timestamps that users did not realize would be written locally.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The natural-language guidance says "Always use Unicode escape for Chinese," which imposes a special rule tied to one language/locale. While intended as a technical workaround, it is stated as a blanket requirement rather than an optional or clearly justified locale-specific constraint.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The file consistently frames user requests, content, and operational guidance in Chinese and even states best practices specifically for Chinese content, but it does not indicate that Chinese is optional or that the skill is intentionally limited to a Chinese-language/regional use case. That can amount to a language/locale policy issue when no opt-in or justification is provided.

Context-Inappropriate Capability

Low
Confidence
88% confidence
Finding
The recommended workflow uses a generic `exec(command="sleep 2")` even though waiting can be handled without shell execution. This normalizes unnecessary command-execution capability inside a posting skill and may encourage broader use of `exec` for convenience, increasing the attack surface beyond what the skill needs.

Static analysis

No suspicious patterns detected.