T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_xhs_hot_articles.py:610- Finding
Path Traversal and Arbitrary File Overwrite Through Report Filename
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its Xiaohongshu search purpose, but it needs review because it can write local report files using unsafe paths and stores search criteria in calendar subscriptions.
Install only if you are comfortable giving the skill a Redfox API key, making external Redfox API calls with your search terms, and creating local HTML reports. Avoid untrusted or path-like keywords, do not use --output-file outside a dedicated reports folder, and treat generated HTML as untrusted. Use calendar subscription only after confirming what search criteria will be stored and how you can cancel it.
scripts/fetch_xhs_hot_articles.py:610Path Traversal and Arbitrary File Overwrite Through Report Filename
scripts/fetch_xhs_hot_articles.py:213HTML Injection Through Unescaped API-Controlled Report Fields
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
body = json.dumps(payload, ensure_ascii=False).encode("utf-8")
req = urllib.request.Request(url, data=body, headers=headers, method="POST")
with urllib.request.urlopen(req, timeout=30) as resp:
status_code = resp.status
raw = resp.read().decode("utf-8")
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>
Referenced artifact was not completely inspected
| SKILL 定义 | `SKILL.md` | 定义 Skill 元数据、意图理解规则、泛化词拓展策略、展示策略、订阅逻辑、自检清单 |
The invocation guidance says users can 'just describe your needs in natural language,' which is broad enough to trigger the skill during ordinary conversation rather than a clearly intentional tool invocation. In an agent environment, this can cause accidental activation, unintended external API calls, or unnecessary processing based on casual mentions instead of explicit user consent.
The skill advertises subscription and scheduled push behavior but does not explain what user data is stored, how long subscription criteria are retained, where notifications are sent, or how users can revoke them. This creates privacy and consent risk because users may provide keywords, schedules, or account-linked destinations without clear data-handling boundaries.
The README says users can 'directly use natural language to describe your needs, without remembering any command format,' which does not define clear activation boundaries or constrained trigger phrases. For a markdown skill description, this is ambiguous enough to risk unintended invocation from ordinary conversational requests.
The skill declares no explicit tool/permission scope, yet the documentation clearly indicates use of environment variables, network access to Redfox API, and local file writes for HTML report generation. Without a manifest-level allowlist, an agent may invoke capabilities broader than users expect, increasing the risk of unintended data exfiltration, local file creation, or policy bypass through overly permissive execution.
The skill metadata describes a search/recommendation tool, but the body adds calendar-based subscription and push behavior, which expands the operational scope into persistence and external scheduling. This creates a consent and capability mismatch: users may authorize a content search skill without realizing it can create long-lived tasks that store and act on their search parameters later.
The skill provides fixed Chinese reply templates such as 回复「拓展」 / 回复「不拓展」 and repeatedly prescribes Chinese-only output phrasing throughout the document. This imposes a specific language on users without documenting an opt-in or offering alternatives, which matches the language/locale policy violation category.
The subscription workflow instructs the agent to create a calendar task containing the current search parameters, but does not explicitly warn that those parameters will be stored in an external scheduling system. Search topics may reveal business strategy, personal interests, or sensitive research themes, so persisting them externally without clear notice creates privacy and consent risk.
Most of the document mandates Markdown table output for results, with no requirement for per-item numbering, recommendation reasons, or embedded HTML cards. The self-check section actively instructs the agent to verify those extra fields, creating a direct contradiction with the earlier output rules and examples.
The manifest describes a tool for keyword-based hot-note search and ranking/recommendation, which implies retrieving and returning content data. In addition to that expected behavior, the code always generates and writes a local HTML file, creating a reporting side effect not stated in the skill description.
All user-facing instructions and examples in the skill description are in Chinese, and the README does not indicate that this language choice is optional or region-specific by design. This may violate language/locale policy where skills should not force a specific language without user opt-in or justification.
The skill states that an HTML report file will be generated, but does not prominently warn users in the top-level description or consent flow that a local filesystem write will occur. Silent file creation can surprise users, leak sensitive search terms into local artifacts, and create persistence on shared or monitored systems.
The document instructs users to configure an API credential via environment variable and also exposes a --debug mode that prints raw API responses, but it does not warn about secret-handling or logging hygiene. In practice, operators may enable debugging in shared environments and inadvertently capture sensitive response data, request metadata, or adjacent configuration details in logs, increasing the chance of credential or data leakage.
L038 的请求示例将 source 写为“"小红书爆款笔记洞察-ClawHub"”,但 L049 的参数说明又声明该字段固定值为“"小红书爆款笔记洞察-GitHub"”。这属于文档内部对同一行为的直接矛盾,会误导实现或调用方对实际请求内容的理解。
No suspicious patterns detected.