T03 · Remote Payload Retrieval and Execution
- Location
docs/user_guide.md:86- Finding
Privileged Execution of a Mutable Remote Installation Script
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its stated WeChat draft-publishing purpose, but it handles powerful account credentials with unsafe documentation and plaintext token storage, so users should review it carefully before installing.
Install only if you are comfortable giving the skill access to a WeChat official account. Use a test account first, avoid pasting real AppSecrets into command lines or committed JSON files, review generated drafts before publishing, remove or change the fixed author/branding, and avoid the sudo/curl installation steps in favor of a least-privilege, pinned install path.
docs/user_guide.md:86Privileged Execution of a Mutable Remote Installation Script
scripts/publish.py:169WeChat Bearer Token Stored in a Plaintext Cache
docs/user_guide.md:219AppSecret Exposed Through Command-Line Arguments and Plaintext Configuration
scripts/publish.py:255External News Data Inserted into HTML Without Escaping or Sanitization
{summary}
" # 头条新闻(前 2 条) html += "{i}. 【{news['category']}】{news['title']}
" html += f"{news['content'][:150]}...
" # 重要更新(第 3-10 条) html += "{i}. {news['title']}
" html += f"{news['summary'][:120]}...
" # 简短摘要(第 11-15 条) html += "{i}. {news['title']}
" ``` ### Technical Analysis Article titles, summaries, categories, and content originate from an external news API. They are concatenated directly into HTML without contextual escaping or allowlist sanitization. String truncation does not neutralize markup. An attacker controlling an article or a compromised upstream feed can include HTML fragments within the truncated length. Those fragments become part of the draft submitted to WeChat. The final effect depends on WeChat's server-side sanitizer and rendering behavior. Even if active scripts are stripped, injected links, formatting, deceptive text, images, or tracking resources may survive and alter the publication. ### Attack Path 1. An attacker publishes an article whose title, description, or content contains crafted HTML. 2. The external news provider includes that article in its response to the Skill's broad AI-related qu ...[truncated 821 chars]docs/user_guide.md:429Unpinned Global Dependency Installation, Including Root-Level Installation
scripts/publish.py:341Developer Branding Is Hardcoded into User Publication Output
AI 行业前沿资讯 · 每日更新
``` ### Technical Analysis The publisher sets a fixed developer identity as the article author and includes fixed branding in the bundled publication template. These values are not derived from the user's WeChat account configuration and cannot be disabled through the supplied default configuration. This does not alter the Agent's session goals or safety constraints, so it is not classified as Skill Instruction Hijacking. It is an output-integrity and transparency issue: normal use can cause a user to publish third-party attribution or promotional branding under the user's own official account. ### Attack Path 1. The user configures the Skill for the user's WeChat account. 2. The normal publication flow creates a draft. 3. The draft payload automatically identifies the developer as the author. 4. If the bundled template is used, the generated article also displays the developer-associated brand. 5. The user may publish the draft without noticing or intending the attribution. ### Impact Assessment The issue does not grant filesystem, operating-system, or WeChat API privileges to an attacker. Its scope is publication integrity and user reputation. Potential consequences include: - Unintende ...[truncated 161 chars]Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
for i in range(1, retry_count + 1):
try:
self.logger.info(f"获取 Token(尝试 {i}/{retry_count})")
response = requests.get(token_url, params=params, timeout=30)
response.raise_for_status()
result = response.json()
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
for i in range(1, retry_count + 1):
try:
self.logger.info(f"创建草稿(尝试 {i}/{retry_count})")
response = requests.post(
draft_url,
params=params,
json=data,
The documented chain curl -fsSL ... | sudo -E bash combines remote content retrieval, shell interpretation, and privileged execution in a single step. This is a classic high-risk pattern because any compromise of the fetched content or delivery path results in immediate root-level arbitrary code execution.
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# 3. 安装 OpenClaw
The README includes what appears to be a real WeChat app_secret in plaintext within setup commands, which is a direct secret exposure. If the credential is valid, attackers could abuse the associated application or account APIs; even if it is a sample, normalizing this practice strongly encourages insecure secret handling by users.
Publishing a plaintext app_secret in the configuration table duplicates the secret exposure and reinforces insecure credential management in user-facing instructions. Because this skill automates access to a public account, compromise of such credentials can enable unauthorized publishing or broader API misuse.
The use of sudo -E specifically preserves the caller's environment while launching a privileged shell for remotely fetched code. That combination can expose sensitive variables and makes the privileged execution context less predictable and therefore more dangerous.
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# 3. 安装 OpenClaw
The use of sudo -E specifically preserves the caller's environment while launching a privileged shell for remotely fetched code. That combination can expose sensitive variables and makes the privileged execution context less predictable and therefore more dangerous.
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# 3. 安装 OpenClaw
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# 3. 安装 OpenClaw
sudo npm install -g openclaw
The guide tells users to install a global npm package with sudo, which grants the package's install scripts root privileges. If the package or a dependency is malicious or compromised, this can lead to full system compromise.
sudo apt-get install -y nodejs
# 3. 安装 OpenClaw
sudo npm install -g openclaw
# 4. 验证安装
openclaw --version
The guide explicitly instructs users to pass the WeChat AppSecret on the command line and store it in a plaintext JSON config file, while also showing it in examples. Command-line secrets can be exposed via shell history, process listings, logs, and screenshots, and plaintext storage increases the chance of credential theft and account compromise.
Recommending sudo npm install -g openclaw as a troubleshooting step normalizes running package installation scripts as root. This increases the blast radius of any malicious or compromised dependency and can turn a supply-chain issue into full host compromise.
npm install -g openclaw
sudo npm install -g openclaw
**Q2: openclaw 命令找不到?**
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 检查配置文件权限
# macOS/Linux:
chmod 600 ~/.agents/skills/wechat-publisher/config/config.json
# Windows: 以管理员身份运行配置命令
The skill advertises automatic collection and scheduled publishing to a public WeChat account without clearly warning that it will autonomously publish externally visible content. In this context, lack of disclosure increases the risk of unintended public posting, reputational harm, and privacy/compliance issues if users enable automation without understanding the consequences.
The README instructs users to pass a WeChat app_secret directly on the command line and does not warn about shell history, terminal logging, screenshots, or CI logs. This creates a realistic credential exposure path, especially because the example uses a secret-like value and encourages unsafe handling of production credentials.
The file’s natural-language description and generated user-facing content are explicitly fixed to Chinese, and the report format later hardcodes Chinese headings and labels. There is no indication that the user can opt into another language or that the locale restriction is intentionally justified as region-specific.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 备用方案:使用固定 API
self.api_sources = [
"https://newsapi.org/v2/top-headlines?category=technology&apiKey=",
"https://api.currentsapi.services/v1/latest-news"
]
def collect_news(self, count=15):
The fallback path fabricates hard-coded headlines and attributes them to real organizations like OpenAI, Google, TechCrunch, and The Verge, then saves and reports them as if they were genuine collected news. This creates an integrity and misinformation risk: downstream users or agents may act on false information believing it came from trusted sources.
The file’s natural-language description and user-facing strings are entirely Chinese and specifically target WeChat official account publishing, but there is no indication that the user can choose another language or that the locale restriction is an explicit opt-in. Under the policy, forcing a specific language/locale without user choice should be flagged unless the constraint is clearly documented and justified.
The code accesses a sensitive credential (WECHAT_APP_SECRET) and can also load the secret from configuration, but it provides no explicit safety warning in comments/docstrings about handling secrets or privacy implications. The existing log messages only report success/failure and do not warn users that credentials are being consumed by the skill.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 获取新 Token
app_secret = self._get_app_secret()
token_url = "https://api.weixin.qq.com/cgi-bin/token"
params = {
"grant_type": "client_credential",
"appid": self.config["app_id"],
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 获取新 Token
app_secret = self._get_app_secret()
token_url = "https://api.weixin.qq.com/cgi-bin/token"
params = {
"grant_type": "client_credential",
"appid": self.config["app_id"],
This request sends app credentials to the WeChat token endpoint, and later requests publish generated article content to WeChat. Although the script logs operational status, it does not clearly disclose to users that credentials and publication content are transmitted to external services.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
for i in range(1, retry_count + 1):
try:
self.logger.info(f"创建草稿(尝试 {i}/{retry_count})")
response = requests.post(
draft_url,
params=params,
json=data,
The publishing flow uploads generated article content to WeChat and also writes publication artifacts locally without any explicit consent prompt, minimization, or sensitivity checks. In an agent skill context, this is more dangerous because users may not realize that externally sourced or model-generated content, along with identifiers like DraftID, is being transmitted and persisted automatically.
The skill explicitly requires a WeChat public-account AppID and AppSecret and states it will automatically publish content to a remote draft box, but the description does not clearly warn users about the sensitivity of these credentials or the fact that the skill will perform authenticated remote actions on their account. This creates informed-consent and credential-handling risk: users may provide powerful secrets without understanding exposure, storage, or misuse implications.