Back to skill

Security audit

小红书达人笔记质检 for bbt

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but its link-fetching helpers can request arbitrary URLs too broadly, so it belongs in Review before installation.

Review before installing. Use it only in an environment where outbound requests are sandboxed, and avoid feeding it arbitrary or attacker-controlled links until URL allowlisting and untrusted-content handling are added.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
scripts/fetch_xhs_content.py:93
Finding

Unrestricted URL Fetching Enables SSRF and Local Resource Access

Content
View full analysis
tuple[int | None, str | None, str]: marker_code = "__HTTP_CODE__:" marker_url = "__URL_EFFECTIVE__:" cmd = [ "curl", "-sL", "-A", user_agent, "--max-redirs", "5", "--connect-timeout", str(timeout_s), url, "-w", f"\n{marker_code}%{{http_code}}\n{marker_url}%{{url_effective}}\n", ] proc = subprocess.run(cmd, capture_output=True, text=True, errors="ignore") out = proc.stdout or "" ``` ```python url: str = args.url http_code: int | None = None effective_url: str | None = None html: str http_code, effective_url, html = fetch_html_with_curl( url, timeout_s=args.timeout_s, user_agent=args.user_agent ) ``` The shell implementation has the same behavior: ```sh URL="" while [ $# -gt 0 ]; do case "$1" in --url) URL="${2:-}" shift 2 ;; ``` ```sh meta="$( curl -sL \ -A "$UA" \ --max-redirs 5 \ --connect-timeout "$TIMEOUT_S" \ -o "$tmp_html" \ -w "\n${marker_code}%{http_code}\n${marker_url}%{url_effective}\n" \ "$URL" 2>/dev/null || true )" ``` ### Technical Analysis Both implementations pass the caller-controlled URL directly to `curl`. They do not validate: - The URL scheme - The initial hostname - Embedded URL credentials - The resolved IP address - Redirect destinations - Whether the destination belongs to an approved Xiaohongshu domain - Whether the destination is loopback, private, link-local, reserved, or multicast The `-L` option automatically follows as many as five redirects. Consequently, even an initially accepta ...[truncated 2115 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:81
Finding

Untrusted Web Content Is Returned to the Agent Without Prompt-Injection Boundaries

Content
View full analysis
0: text_preview = text[: args.max_chars] else: text_preview = text hashtags = _extract_hashtags(text, args.max_tags) if text else [] ats = _extract_ats(text, args.max_ats) if text else [] result: dict[str, Any] = { "url": url, "http_status": http_code, "final_url": effective_url, "title": title, "description": desc, "hashtags": hashtags, "ats": ats, "text_preview": text_preview, } json.dump(result, sys.stdout, ensure_ascii=False, indent=2) sys.stdout.write("\n") ``` The shell implementation similarly returns the extracted page text: ```sh text_no_tags="$(printf "%s" "$html" | sed 's/<[^>]*>/ /g')" text_preview="$text_no_tags" if [ "$MAX_CHARS" -gt 0 ]; then text_preview="$(printf "%s" "$text_preview" | awk -v n="$MAX_CHARS" '{ if(length($0)>n){print substr($0,1,n)} else {print $0} }')" fi ``` ```sh title_esc="$(escape_json "${title:-}")" desc_esc="$(escape_json "${desc:-}")" preview_esc="$(escape_json "${text_preview:-}")" cat <
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向小红书笔记的合规审核/词表维护技能,核心能力应包括基于品牌词表和规则进行检查并输出结构化质检结果。实际代码仅接收 URL,调用 curl 抓取页面,解析 HTML 中的 title、description、hashtags、@账号和文本预览后输出 JSON。虽然抓取内容可能是后续质检的前置步骤,但就这段代码本身而言,缺少任何合规判断逻辑、词表访问逻辑、文件更新逻辑和报告判定逻辑,因此与声明的主要用途不一致,属于明显描述-行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是完整的小红书品牌合规质检与词表维护技能,而提供的代码片段只是底层内容抓取/预处理工具。它确实与小红书链接相关,也提取了标题、话题和@,可作为后续质检的支持步骤;但当前代码没有执行任何品牌合规判定、广告法审查、竞品检查、品牌词表比对,亦未读写 assets/brand-names-correct.txt、assets/brand-names-wrong.txt 或更新任何词表文件。因此代码实际行为仅覆盖声明中的很小一部分支撑功能,和声明的主要用途存在实质性不匹配。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- mac/Linux:`sh scripts/fetch_xhs_content.sh --url "<链接URL>"`

Ae1

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
- mac/Linux:`sh scripts/fetch_xhs_content.sh --url "<链接URL>"`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill explicitly instructs use of Shell and network access to fetch URLs and validate links, but it declares no tool scope or allowed-tools boundaries. Without explicit scoping, an agent may invoke broader shell/network capabilities than users expect, increasing the attack surface for unintended command execution, SSRF-style requests, or unsafe handling of untrusted URLs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill directs the agent to modify files inside the repository/skill directory based on user input, but it does not require a clear upfront warning that repository files will be changed. In an adversarial setting, this can enable prompt-driven tampering with configuration files, persistence of malicious content, or accidental corruption of governance data that future runs will trust.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This plain-text file consists entirely of Chinese terms, indicating the skill enforces or depends on a specific language/locale. Under the policy, locale-specific behavior should either offer user choice or clearly document and justify the constraint; this file provides neither.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This file contains only Chinese hashtags and topic text, which implies a fixed language/locale requirement in the skill content. Because there is no indication of user opt-in, alternative language support, or a documented region-specific justification in this file, it may violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire guidance is written as mandatory Chinese-language quality rules and specifies exact brand/account casing and spacing conventions without any indication that users may opt into another language or locale. Under the policy for natural-language violations, forcing a specific language or locale without opt-in should be flagged unless the restriction is explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/fetch_xhs_content.py (reported line 110)May include surrounding context.

python
"-w",
        f"\n{marker_code}%{{http_code}}\n{marker_url}%{{url_effective}}\n",
    ]
    proc = subprocess.run(cmd, capture_output=True, text=True, errors="ignore")
    out = proc.stdout or ""

    http_code: int | None = None

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script claims to process Xiaohongshu note links, but it actually accepts any user-supplied URL and fetches it server-side. This creates an SSRF primitive that can be used to probe internal services, access cloud metadata endpoints, or make requests to unintended hosts from the agent's network environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script performs an outbound HTTP request to a user-supplied URL via curl without any explicit disclosure, confirmation step, or visible warning to the user. In an agent skill context, this can expose user-provided URLs, trigger access to attacker-controlled hosts, and create SSRF-like behavior against internal or sensitive network targets if the runtime has such access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This plain-text file contains only fixed bilingual/Chinese brand-name renderings with no indication that language choice is optional or context-specific. Under the policy rule for natural-language violations, this can be interpreted as enforcing a specific locale/language form without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language usage/help text is entirely in Chinese and describes the script behavior without offering any language or locale choice. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation unless the constraint is clearly justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.