Back to skill

Security audit

小红书爆款笔记查询

Security checks for vulnerabilities and agentic risk

Overview

This search skill needs review because it automatically starts payment setup and generates HTML reports that can contain untrusted scripts.

Before installing, seek fixes for HTML escaping and require your approval before payment-tool installation or recharge. Verify the merchant and exact amount yourself. Search terms are sent to Redfox, so avoid confidential queries; enable recurring calendar subscriptions only when wanted.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/fetch_xhs_hot_articles.py
Finding

Unescaped external author names enable script execution in generated reports

Content
View full analysis

Impact

Injected JavaScript can alter the report, impersonate report controls, and transmit report contents to an attacker-controlled endpoint. Native code execution or access to arbitrary local files is not established.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (26)

Tainted flow: 'req' from os.environ.get (line 130, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/fetch_xhs_hot_articles.py (reported line 132)May include surrounding context.

python
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")

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The search and reporting behavior matches the core description. However, emit_payment_required() does not invoke Alipay, monitor payment, or retry the original query after recharge. Its printed instructions describe actions for an external agent rather than executable behavior in this script. No accompanying orchestration implementing those actions is supplied. Score-based ranking may be performed by the API, but the script itself merely preserves returned order. HTML output and API-key use are supporting implementation details, not independent mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The only supplied command is source ~/.zshrc. It accesses and executes a local shell configuration file; it does not demonstrate Xiaohongshu searching, ranking, or payment handling. Loading shell configuration can support environment setup, but no connection to the declared workflow is shown here. The contents of ~/.zshrc are unknown, so no specific downstream actions or malicious intent can be inferred.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 有赛道关键词:`python scripts/fetch_xhs_hot_articles.py --keyword <关键词> --start-date <日期>`

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 无赛道关键词(查询全站热门):`python scripts/fetch_xhs_hot_articles.py --keyword "" --start-date <日期>`

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 多个关键词用逗号分隔:`python scripts/fetch_xhs_hot_articles.py --keyword "减脂餐,职场穿搭,健身" --start-date <日期>`

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
`scripts/fetch_xhs_hot_articles.py` 退出码含义:**0** = 正常返回(含"暂无数据"),按标准输出格式呈现结果;**1** = 参数/鉴权/接口错误,按脚本提示告知用户;**3** = **积分不足,需要充值**,按下述流程接管。

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
` **自动监听支付回调到账**,无需用户再手动确认;到账(`outcome=success`)后自动用用户原始的查询参数(关键词、时间范围、分页)重新运行 `scripts/fetch_xhs_hot_articles.py` 输出结果。

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 关键词搜索(默认近7天) | `python scripts/fetch_xhs_hot_articles.py --keyword "关键词" --start-date <日期>` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 全站热门 | `python scripts/fetch_xhs_hot_articles.py --keyword "" --start-date <日期>` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 多关键词搜索 | `python scripts/fetch_xhs_hot_articles.py --keyword "词1,词2,词3" --start-date <日期>` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 分页查询 | `python scripts/fetch_xhs_hot_articles.py --keyword "关键词" --start-date <日期> --page-num 1 --page-size 50` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 搜索脚本 | `scripts/fetch_xhs_hot_articles.py` | 调用红狐 API 获取小红书热门笔记,支持 --keyword、--start-date、--page-num、--page-size 参数,自动生成 HTML 报告 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **核心脚本**:`scripts/fetch_xhs_hot_articles.py` — 调用红狐 API 获取小红书热门笔记数据并生成 HTML 报告

A search failure is framed as permission to initiate a financial transaction automatically.

High
Category
Prompt Injection
Confidence
94% confidence
Finding

The visible workflow treats an insufficient-credit response as a trigger for payment orchestration, including submit-payment, without explicitly requiring approval of the amount and merchant before submission. A search request does not authorize spending, and allowing API-supplied payment information to drive a wallet-capable agent risks unauthorized charges; the unavailable reference may contain safeguards, but they cannot be verified here.

Content

No source excerpt is available for this finding.

Search-error recovery instructions redirect the agent into a payment workflow using API-supplied transaction details.

High
Category
Prompt Injection
Confidence
97% confidence
Finding

An insufficient-credit response causes the script to emit imperative instructions directing the agent to initiate an Alipay workflow using API-supplied cashierUrl, amount, and goodsName, without validation or an explicit approval gate in the supplied code. The skill metadata reinforces automatic recharge, allowing a compromised or malicious upstream response to redirect a search task into an unapproved payment attempt or attacker-selected checkout; this script does not itself complete a transfer.

Content

No source excerpt is available for this finding.

The search workflow does not disclose that users' search keywords are transmitted to the third-party Redfox Hub API.

Medium
Category
Output Handling
Confidence
86% confidence
Finding

The usage guide directs users to supply keywords that are queried through the skill's API-backed search workflow. Although lines 39–42 identify Redfox Hub as the API-key provider and discuss credential security, the README does not explain that search terms leave the user's environment, which matters if queries contain confidential topics or client information.

Content

No source excerpt is available for this finding.

The search instructions do not disclose that users' search keywords are sent to the third-party Redfox API.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The README identifies Redfox as the API credential provider but does not clearly explain that search keywords are transmitted to that third party. Users could therefore submit confidential campaign plans, unpublished product names, or personal information without understanding the disclosure. External processing is consistent with this search tool's purpose, which reduces suspicion of malicious intent, but the README alone does not establish the actual request payload or the provider's retention practices.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_write, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Search keywords extracted from user descriptions are sent to a third-party API without an explicit privacy notice.

Medium
Category
Output Handling
Confidence
91% confidence
Finding

L078–L088 instruct the agent to extract keywords from the user's description and execute the search; L116 specifically includes self-introductions as a source. Although the document identifies Redfox as the API provider, it does not warn that these user-derived terms will be transmitted to that third party, potentially exposing personal interests or confidential research topics.

Content

No source excerpt is available for this finding.

The skill directs calendar writes for recurring subscriptions, beyond the manifest's search and recharge scope.

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The manifest at L003 describes searching and ranking popular notes, plus automatic Alipay recharge, but does not declare calendar integration or recurring task creation. L376-L380 instruct the agent to call calendar_create with search parameters and recurring reminders, introducing persistent changes to a separate service. Although the workflow requests user consent, this is an additional capability rather than a necessary implementation detail of searching.

Content

No source excerpt is available for this finding.

Automatically installs a payment CLI without warning the user about local system changes or third-party code execution.

Medium
Category
Output Handling
Confidence
95% confidence
Finding

An insufficient-credit response causes the agent to install third-party executable software if the CLI is absent, without a separate approval step or explanation of local changes. A content-search request is not itself authorization to install software, and this workflow expands a routine API failure into local code execution in a payment-related context.

Content

No source excerpt is available for this finding.

MCP server referenced without pinned version: 'npx -y @alipay/agent-payment'.

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The installation command executes a mutable @latest npm package with automatic confirmation, rather than a reviewed, pinned release. Although this is a payment CLI rather than an MCP server, the underlying supply-chain concern is valid: a compromised release could execute code with the agent's local privileges, potentially accessing credentials or tampering with payment handling.

Content

No source excerpt is available for this finding.

Sends payment details to a payment-link service without a user-facing data-sharing disclosure.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The workflow instructs the agent to submit the original cashier URL, product name, and order amount to generate a payment short link. Although these fields and commands are documented for the agent, there is no instruction to inform the user that their payment details, including the signed cashier URL, will be shared with the payment service.

Content

No source excerpt is available for this finding.