T05 · Unauthorized Access and Privilege Escalation
- Location
src/channel.ts:42- Finding
Unrestricted Local File Disclosure Through Outbound Media Upload
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This WeChat channel plugin is mostly coherent, but it includes under-scoped file upload, URL download, log upload, and token logging behavior that could expose local files or credentials.
Review this plugin before installing on a machine with sensitive files or cloud credentials. Only use it in an isolated OpenClaw environment, avoid debug logging during login, do not run the log-upload command except to a trusted HTTPS endpoint, and treat stored Weixin credentials and context-token files as secrets.
src/channel.ts:42Unrestricted Local File Disclosure Through Outbound Media Upload
src/cdn/upload.ts:30Server-Side Request Forgery Through Unrestricted Remote Media Downloads
src/log-upload.ts:91Arbitrary File Exfiltration Through the Log Upload Command
src/auth/login-qr.ts:90Weixin Bot Token Exposure in QR Login Debug Logs
If the plugin actually performs log collection, remote upload, config deletion, uninstall execution, or maintenance utilities unrelated to the stated WeChat channel purpose, then the manifest materially understates risky behavior. Hidden or undocumented capabilities are dangerous because they can enable data exfiltration, destructive changes, or command execution under the cover of an innocuous messaging plugin.
If the plugin actually performs log collection, remote upload, config deletion, uninstall execution, or maintenance utilities unrelated to the stated WeChat channel purpose, then the manifest materially understates risky behavior. Hidden or undocumented capabilities are dangerous because they can enable data exfiltration, destructive changes, or command execution under the cover of an innocuous messaging plugin.
@mariozechner/pi-coding-agent 0.61.1 carries multiple advisories including XSS in HTML exports, predictable temporary extension paths, and credential exposure via auth.json write races. Although this package is a transitive devDependency through openclaw and not obviously required for the 微信 channel runtime, it is a genuine vulnerability set with meaningful local impact in developer or CI environments where the coding-agent features may execute and handle credentials or generated HTML.
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
* Called after a successful QR login to ensure only the latest account remains
* for a given WeChat user, preventing ambiguous contextToken matches.
*
* @param onClearContextTokens callback to clear context tokens for the removed account
*/
export function clearStaleAccountsForUserId(
currentAccountId: string,
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
/**
* Legacy single-file token: `credentials/openclaw-weixin/credentials.json` (pre per-account files).
*/
function loadLegacyToken(): string | undefined {
const legacyPath = path.join(resolveStateDir(), "credentials", "openclaw-weixin", "credentials.json");
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
/**
* Legacy single-file token: `credentials/openclaw-weixin/credentials.json` (pre per-account files).
*/
function loadLegacyToken(): string | undefined {
const legacyPath = path.join(resolveStateDir(), "credentials", "openclaw-weixin", "credentials.json");
Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.
return ctx;
}
/** Extract the context_token from an inbound WeixinMsgContext. */
export function getContextTokenFromMsgContext(ctx: WeixinMsgContext): string | undefined {
return ctx.context_token;
}
The README instructs users to execute a package via npx without pinning an exact version, which can cause installation or execution of whatever package version is current at the time. If the package is compromised, a malicious release is published, or a dependency-chain attack occurs, users may execute attacker-controlled code directly on their systems.
The README states that login credentials are saved locally automatically but gives no warning that these credentials are sensitive or guidance on how they are stored and protected. In a plugin handling WeChat account access, unclear credential handling increases the risk of token theft, accidental disclosure, insecure backups, or weak filesystem permissions leading to account compromise.
The README instructs users to execute an unpinned package directly via npx, which fetches and runs the latest published code at install time. This creates a supply-chain execution risk: if the package is compromised, replaced, or updated with malicious code, users may execute attacker-controlled code on their local system.
The README states that login credentials are automatically saved locally but does not warn users that these artifacts are sensitive, where they are stored, or how to protect or revoke them. Stored authorization material can be stolen from disk backups, shared machines, or malware, enabling unauthorized access to linked WeChat accounts.
The README documents API requests transmitting bearer tokens and user identifiers but does not explicitly require transport protections or warn that these values are sensitive authentication and identity data. In this plugin context, interception, logging, or misrouting of these headers could expose account access and user metadata to unauthorized parties.
The skill metadata declares installation and operational steps for a plugin that inherently needs network access and likely environment/config interaction, but it does not declare any explicit tool scope or permissions boundary. This is dangerous because users and automated platforms cannot accurately understand or constrain what the skill may access, increasing the risk of overprivileged execution and unsafe installation of a package with external connectivity.
The skill advertises QR-code login and message send/receive capability but does not provide a clear warning that authorization may grant ongoing access to WeChat communications and related account data. This is dangerous because users may authorize the plugin without understanding the persistence and privacy implications of connecting a messaging account.
The function persists token-bearing account data to per-account JSON files, which is a safety-relevant file write involving credentials. Although there is an internal comment and best-effort chmod, there is no confirmation prompt, user-visible log/print, or other disclosure in this file to inform the user that authentication data is being stored locally.
This function removes multiple on-disk files, including credentials and context-token state, which is a destructive local operation. The code has only comments and silent exception handling, with no user-facing disclosure, prompt, or visible log at the point of deletion.
The code prints and logs QR-code URLs obtained from an external service directly to stdout and logs. In a QR-login flow, that URL is effectively a bearer-like login artifact: anyone who can read terminal output, CI logs, remote console sessions, or centralized logging may be able to view or reuse the QR content and interfere with or hijack the login process before confirmation.
This code presents user-facing login instructions entirely in Chinese, including status and QR-scan guidance, without offering a language choice. That is a natural-language locale policy issue because the skill forces a specific language for interactive workflow messages.
The skill manifest frames the plugin as a Weixin communication channel integration. Spawning a child process to invoke a plugin-management uninstall command is an administrative capability unrelated to receiving or replying to WeChat messages, and it expands the skill's operational power beyond its stated purpose.
The CLI implements arbitrary log exfiltration by reading a local file and POSTing it to a user-supplied or configuration-supplied URL. Even if framed as diagnostics, this creates a built-in data export path for potentially sensitive logs, and the feature is not tightly constrained to trusted destinations or explicit safe file scopes beyond the default log directory.
The code persists per-user context_token values to disk in plaintext JSON under an account-derived filename so sessions survive restarts. If the state directory is readable by other local users, included in backups, or exposed via another file-read bug, an attacker could recover active tokens and potentially impersonate or hijack outbound messaging context for affected accounts.
}
/**
* Restore persisted context tokens for an account into the in-memory map.
* Called once during gateway startAccount to survive restarts.
*/
export function restoreContextTokens(accountId: string): void {
This TypeScript file contains multiple natural-language strings in Chinese for debug traces and user-visible error/debug messages, beginning at L101-L104 and continuing elsewhere in the file. Because the skill does not offer a language preference or document that it is intentionally limited to Chinese-speaking users, it violates the language/locale policy criterion.
The primary README is written in English and links to a Simplified Chinese version, but it does not explain language selection or locale expectations for users. Under the policy, forcing a specific language without explicit opt-in can be a natural-language policy concern unless the locale constraint is documented and justified.
The natural-language content of the skill description and instructions is entirely in Chinese, with no indication that other languages are supported or that the locale restriction is intentional and required. Per policy, forcing a specific language without user opt-in can be a natural-language policy issue.
The manifest sets the channel to "openclaw-weixin", which implies a specific platform/locale selection in configuration text. Forcing a locale- or platform-specific context without any accompanying opt-in or justification can violate language/locale policy expectations.
Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal