Back to skill

Security audit

只需要发律动文章链接,帮你抓取并保存到 ChainThink 后台

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated import-and-save purpose, but it includes an embedded ChainThink admin token and can upload loosely validated web content without clear user control.

Review before installing. The publisher should remove and revoke the embedded JWT, require a secure user-provided token, enforce an exact BlockBeats URL allowlist, sanitize or preview imported HTML, and ask for confirmation before creating a ChainThink draft.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
fetch.sh:43
Finding
Hard-Coded Administrative API Token in Executable Script<![CDATA[ ## Vulnerability Details **File Location**: `fetch.sh`, lines 43-45 and 81-88 **Vulnerability Type**: Hard-coded authentication credential **Risk Level**: High ### Vulnerable Code ```bash # 从 TOOLS.md 读取 token(如果存在) TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVVUlEIjoiY2Y3MzBlZWUtODU3YS00MWRlLTljM2EtNTMxODY5NDU0OTE5IiwiSUQiOjUxLCJVc2VybmFtZSI6ImxhYmlkIiwiTmlja05hbWUiOiJsYWJpZCIsIkF1dGhvcml0eUlkIjoxMDEsIkJ1ZmZlclRpbWUiOjg2NDAwLCJpc3MiOiJxbVBsdXMiLCJhdWQiOlsiR1ZBIl0sImV4cCI6MTc3MzI5NzIwNiwibmJmIjoxNzcyNjkyNDA2fQ.mt1dR1Qom9HJ6WIfWeGgKm0dKa_Ekoe6HWiO0uGwfgo" ``` The credential is subsequently sent to an administrative API: ```bash # 调用 ChainThink API RESPONSE=$(curl -s 'https://api-v2.chainthink.cn/ccs/v1/admin/content/publish' \ -H 'Content-Type: application/json' \ -H 'X-App-Id: 101' \ -H "x-token: $TOKEN" \ -H 'x-user-id: 51' \ --data-raw "$PAYLOAD") ``` ### Technical Analysis The script embeds a complete JWT directly in source code and uses it to authenticate to the ChainThink administrative content-publishing API. Any person or process able to obtain the project files can extract the token without needing access to a protected credential store. The token also contains decodable account metadata, including a user ID, username, UUID, and authority identifier. JWT encoding does not provide confidentiality. Although the credential may expire, source control history, copied packages, build artifacts, and cached distributions can continue to expose it. If the token is refreshed by replacing it in source code, the same flaw will recur. This behavior also contradicts `SKILL.md`, which says that the token must be supplied through `TOOLS.md`. The implementation never reads that file and instead always uses the embedded credential. ### Attack Path 1. An attacker downloads, receives, or otherwise reads the skill package. 2. The attacker opens `fetch.sh` and extracts the JWT assigned to `TOKEN`. 3. The attacker decodes the JWT to identify ...[truncated 1104 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Revoke or rotate the exposed JWT immediately, even if it appears to have expired. 2. Remove the credential from the current source tree and all accessible repository history, release archives, logs, and build artifacts. 3. Load the token from a protected environment variable or dedicated secret manager: ```bash : "${CHAINTHINK_TOKEN:?CHAINTHINK_TOKEN must be configured}" TOKEN="$CHAINTHINK_TOKEN" ``` 4. Never store live credentials in `SKILL.md`, `TOOLS.md`, source-controlled configuration, examples, or shell scripts. 5. Restrict the replacement credential to the single required publishing operation and the minimum required account scope. 6. Add automated secret scanning to commits and release pipelines. 7. Avoid printing the token or verbose HTTP request headers to logs. 8. Implement server-side token rotation, short expiration, revocation, and auditing for unusual publishing activity. 9. Review ChainThink audit logs for unauthorized requests made using the exposed account. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
fetch.sh:7
Finding
Insufficient URL Validation Enables Arbitrary Navigation and Untrusted HTML Import<![CDATA[ ## Vulnerability Details **File Location**: `fetch.sh`, lines 7-17, 23-40, 52-73, and 81-88 **Vulnerability Type**: Arbitrary URL navigation and unsafe ingestion of untrusted HTML **Risk Level**: Medium ### Vulnerable Code The only URL validation requires the supplied value to end in digits: ```bash ARTICLE_URL="$1" if [[ -z "$ARTICLE_URL" ]]; then echo "用法: $0 <BlockBeats文章URL>" echo "示例: $0 https://www.theblockbeats.info/news/61465" exit 1 fi # 提取文章ID ARTICLE_ID=$(echo "$ARTICLE_URL" | grep -oE '[0-9]+$') if [[ -z "$ARTICLE_ID" ]]; then echo "错误: 无法从URL提取文章ID" exit 1 fi ``` The unvalidated URL is opened directly, and page-controlled values are extracted: ```bash # 使用浏览器提取文章内容 ARTICLE_DATA=$(openclaw browser --action=act --kind=evaluate \ --url="$ARTICLE_URL" \ --fn='() => { const data = window.__NUXT__.data[0]; return { title: data.info.title, abstract: data.info.abstract, content: data.info.content }; }' 2>/dev/null | jq -r '.result') TITLE=$(echo "$ARTICLE_DATA" | jq -r '.title') ABSTRACT=$(echo "$ARTICLE_DATA" | jq -r '.abstract') CONTENT=$(echo "$ARTICLE_DATA" | jq -r '.content') ``` The extracted HTML is placed directly into the publishing payload: ```bash # 构建 JSON payload PAYLOAD=$(jq -n \ --arg title "$TITLE" \ --arg text "$CONTENT" \ --arg abstract "$ABSTRACT" \ '{ "id": "0", "info": {}, "is_translate": true, "translation": { "zh-CN": { "title": $title, "text": $text, "abstract": $abstract } }, "type": 5, "admin_detail": {}, "strong_content_tags": {}, "chain_is_calendar": false, "chain_calendar_time": 0, "chain_calendar_tendency": 0, "is_push_bian": 2, "content_pin_top": 0, "is_public": false, "user_id": "3", "chain_fixed_publish_time": 0, "as_user_id": "3", "is_chain": true, "chain_airdrop_time": 0, "chain_airdrop_time_end": 0 }') ``` The resulting content i ...[truncated 3364 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse the URL using a real URL parser rather than a trailing-digit regular expression. 2. Require all of the following: - Scheme exactly equal to `https`. - Hostname exactly equal to `www.theblockbeats.info`. - No unexpected port. - Path matching `^/news/[0-9]+/?$`. - No embedded credentials. 3. Reject redirects to origins outside the same allowlist, and validate the final URL after navigation. 4. Where possible, construct the destination URL from a validated numeric article ID rather than navigating to an arbitrary user-provided URL. 5. Configure the browser runtime to block loopback, link-local, private-network, metadata-service, and local-file destinations unless explicitly required. 6. Sanitize imported HTML with a strict allowlist before submission. Remove scripts, event-handler attributes, active embedded content, unsafe URL schemes, forms, and dangerous SVG or MathML constructs. 7. Enforce equivalent or stronger sanitization in ChainThink before storing and rendering content. 8. Validate extracted values for expected type, maximum size, and required fields before publishing. 9. Present the source hostname and a content preview to the operator before an authenticated draft is created. 10. Add tests covering malicious hosts, alternate schemes, embedded credentials, ports, redirects, malformed paths, and crafted HTML. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The script embeds a live-looking JWT token directly in source code while claiming it is read from TOOLS.md, which is a strong secret-handling failure. Anyone with access to the script can reuse the token to call the ChainThink API as the associated user, potentially creating, modifying, or abusing content until the token is revoked or expires.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The skill explicitly instructs the agent to retrieve an authentication token from TOOLS.md, which expands the skill's access to stored secrets. While a token is needed to call the destination admin API, directing the agent to read credentials from another file creates a secret-access pattern that can be abused or reused beyond the narrow article-import task.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill tells users to store and use an API token but does not include adequate handling guidance for sensitive credentials. This increases the chance that users place long-lived admin tokens into ordinary markdown files, where they may be exposed to other tools, logs, or unintended readers.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The skill instructs the agent to send scraped article content together with authentication headers to an external admin API, but it does not clearly warn the user that a network transmission to a third-party service will occur. Even if the operation is the intended function, the lack of explicit disclosure reduces informed consent around external data transfer and credential use.

External Transmission

Medium
Category
Data Exfiltration
Content
调用 API:

```bash
curl 'https://api-v2.chainthink.cn/ccs/v1/admin/content/publish' \
  -H 'Content-Type: application/json' \
  -H 'X-App-Id: 101' \
  -H 'x-token: <从TOOLS.md读取>' \
Confidence
78% confidence
Finding
The skill performs an authenticated external transmission to an admin API, including article data and sensitive headers. External transmission is central to the skill's purpose, so this is not malicious on its face, but it remains security-relevant because it moves data and credentials off-tool and into a remote service with elevated publishing capabilities.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script automatically sends fetched article title, abstract, and content to a remote API without an explicit confirmation step or clear warning at the point of transmission. In an agent skill context, this increases the risk of unintended data exfiltration, especially if the fetched page contains sensitive, proprietary, or unexpectedly private content.

External Transmission

Medium
Category
Data Exfiltration
Content
}')

# 调用 ChainThink API
RESPONSE=$(curl -s 'https://api-v2.chainthink.cn/ccs/v1/admin/content/publish' \
  -H 'Content-Type: application/json' \
  -H 'X-App-Id: 101' \
  -H "x-token: $TOKEN" \
Confidence
90% confidence
Finding
The curl call transmits collected article data and associated authentication headers to an external service, creating a clear outbound data path. In this skill, the danger is elevated because the transmission is coupled with a hardcoded token and automated publishing behavior, which can enable unauthorized or opaque content submission.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The file presents all user-facing instructions in Chinese, and the payload later hard-codes the translation locale as zh-CN. There is no indication that users may opt into another language or that the locale restriction is a documented, justified regional requirement.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The request body stores content only under the zh-CN locale. This is a natural-language/locale constraint that may violate organizational language-choice policy when users are not given a choice and no region-specific justification is stated.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
Comments and terminal output throughout the script are in Chinese, including usage and status messages, with no option for another language. This can violate language/locale policy when a skill imposes a specific language without user opt-in or a documented regional constraint.

Static analysis

No suspicious patterns detected.