Back to skill

Security audit

Weixin OpenClaw Login

Security checks for vulnerabilities and agentic risk

Overview

This Weixin login skill fits its stated purpose, but it should be reviewed because it can print a bot login token and runs an unpinned installer.

Review before installing. Use this skill only if you trust the Tencent Weixin OpenClaw package and are comfortable with it accessing Weixin login state. Do not paste or share raw polling output, terminal logs, or account files unless bot_token and related account identifiers are redacted. Prefer a pinned, reviewed installer version if available.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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

Error
Location
scripts/poll-login-status.py:19
Finding

Authentication Credential Disclosed Through Standard Output

Content
View full analysis

Vulnerability Details

File Location: scripts/poll-login-status.py:19
Vulnerability Type: Sensitive authentication token exposure
Risk Level: High

Vulnerable Code

python
for i in range(max_polls):
    req = urllib.request.Request(url, headers=headers)
    with urllib.request.urlopen(req, timeout=40) as resp:
        data = json.loads(resp.read().decode())
    print(time.strftime('%H:%M:%S'), json.dumps(data, ensure_ascii=False))
    status = data.get('status')
    if status in ('confirmed', 'expired') or data.get('bot_token'):
        break

Technical Analysis

The polling endpoint can return a bot_token containing an account identifier and secret after the user confirms the QR login. The script serializes and prints the complete response before testing whether bot_token is present.

Sending the QR session token to Tencent's documented status endpoint is necessary for the declared login workflow. Printing the returned authentication credential is not necessary. Standard output may be retained by agent transcripts, CI/CD logs, terminal capture systems, subprocess callers, or centralized monitoring. This creates a secondary disclosure channel for a reusable secret.

Attack Path

  1. A user invokes the polling script with a valid QR session token.
  2. The user scans and confirms the Weixin login request.
  3. Tencent's endpoint returns a response containing bot_token.
  4. The script prints the complete JSON response, including the token.
  5. An agent transcript, log collector, subprocess caller, or another party with output access captures the credential.
  6. An unauthorized party uses the exposed token wherever it is accepted to impersonate or operate the connected bot account.

Impact Assessment

Successful exploitation discloses an authentication secret associated with the connected Weixin bot. Depending on the token's server-side permissions and lifetime, an attacker may ...[truncated 292 chars]

Remediation
View remediation

Remediation Suggestions

  • Never print the complete status response when it may contain authentication material.
  • Construct an explicit output object containing only non-sensitive fields, such as the status and a boolean indicating whether authentication succeeded.
  • Redact bot_token, account identifiers, and other sensitive response fields before logging.
  • Ensure exception handlers and debugging modes do not serialize the unredacted response.
  • Document that users must not paste raw login responses or local account files into chats, tickets, or logs.
  • Consider returning sensitive credentials only through a protected in-memory interface if downstream processing genuinely requires them.

Example hardening approach:

python
safe_output = {
    'status': data.get('status'),
    'authenticated': bool(data.get('bot_token')),
}
print(time.strftime('%H:%M:%S'), json.dumps(safe_output))

T08 · Insecure Dependencies

Warning
Location
SKILL.md:12
Finding

Unpinned Package Is Automatically Downloaded and Executed

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:12-13
Vulnerability Type: Unsafe third-party dependency execution
Risk Level: Medium

Vulnerable Code

markdown
1. Install or update the plugin:
   - `npx -y @tencent-weixin/openclaw-weixin-cli install`

Technical Analysis

The documented command uses npx -y to resolve, download, and execute a package without pinning an exact reviewed version or requesting interactive confirmation. The package name is consistent with the declared Tencent integration, and the project contains no evidence that the current package is malicious. Nevertheless, the effective code executed by this instruction can change after the Skill itself has been reviewed.

This creates a supply-chain trust boundary: compromise of the registry account, package publication process, dependency graph, or mutable package release could cause users to execute unexpected code. The -y option further removes the normal installation confirmation.

Attack Path

  1. An attacker compromises the upstream package publication process, registry account, or a dependency included by the resolved package version.
  2. A malicious or compromised package version becomes the version resolved by the unpinned package name.
  3. A user follows the Skill instruction and runs the npx -y command.
  4. npx downloads and executes the altered package without an interactive approval step.
  5. The package executes with the privileges of the user running the command and can access resources available to that account.

Impact Assessment

A compromised package could execute arbitrary code with the invoking user's privileges. Potentially exposed resources include OpenClaw configuration, local account state, Weixin bot credentials, environment variables, and other files readable or writable by that user.

The finding does not show that the named package is currently compromised. The risk arises from unpinned, un ...[truncated 44 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to an exact version that has been reviewed, for example package-name@X.Y.Z.
  • Maintain a lockfile and verify registry integrity metadata where the installation workflow supports it.
  • Review the package's lifecycle scripts and transitive dependencies before recommending execution.
  • Remove -y for security-sensitive installations so users receive an explicit confirmation opportunity.
  • Prefer installing from a trusted, reproducible artifact with a documented cryptographic checksum or signature.
  • Establish an update process in which new versions are reviewed before the pinned version in the Skill is changed.
  • Run installation with the least-privileged account appropriate for the task and avoid elevated privileges.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (7)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 获取新二维码链接:`scripts/get-login-url.js`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 获取新二维码链接:`scripts/get-login-url.js`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 轮询扫码状态:`scripts/poll-login-status.py <qrcode>`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 轮询扫码状态:`scripts/poll-login-status.py <qrcode>`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 轮询扫码状态:`scripts/poll-login-status.py <qrcode>`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill contains explicit network-capable commands and scripts that call external Tencent endpoints, but the metadata does not declare any tool scope or allowed-tools/permissions. This creates a mismatch between what the skill can do and what reviewers or enforcement mechanisms may expect, increasing the chance of unintended external requests and reducing auditability.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx -y @tencent-weixin/openclaw-weixin-cli install without pinning an exact version causes execution of whatever package version is current at runtime. If the upstream package is compromised, updated unexpectedly, or a malicious version is published, users may execute unreviewed code with the skill's privileges.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.