Back to skill

Security audit

Xiaohongshu Matrix Notes

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent for RedNote content production, but it sends account data and images to third-party APIs and includes scripts with under-scoped network and file-write behavior that users should review before installing.

Install only if you are comfortable with TikHub and Ofox receiving the relevant account identifiers, prompts, product images, and persona/reference images. Use non-sensitive assets, keep API keys limited in scope, avoid untrusted output names, and review or harden the scripts before running them in a sensitive network or project directory.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/fetch_xhs.py:76
Finding

Unchecked Output Name Allows Directory Traversal and File Overwrite

Content
View full analysis
3 else 5 outdir = os.path.join(os.path.dirname(__file__), "..", "账号数据", outname) os.makedirs(os.path.join(outdir, "covers"), exist_ok=True) info = api_get("get_user_info", user_id=user_id).get("data", {}) raw = fetch_all_notes(user_id, max_pages) slimmed = [slim(n) for n in raw] slimmed.sort(key=lambda x: x["likes"] + x["collected"], reverse=True) json.dump({"user_info": info, "notes": slimmed}, open(os.path.join(outdir, "notes.json"), "w"), ensure_ascii=False, indent=2) ``` ```python open(os.path.join(outdir, "summary.md"), "w").write("\n".join(lines) + "\n") ``` ```python open(os.path.join(outdir, "covers", f"{i:02d}{ext}"), "wb").write(data) ``` ### Technical Analysis The second command-line argument is incorporated directly into an output path without validation or canonical containment checks. Python path joining does not guarantee that the result remains beneath the intended `账号数据` directory: - An absolute `outname` replaces the preceding path components. - An `outname` containing `../` can traverse to parent directories. - Existing symbolic links in the selected output tree can redirect writes elsewhere. The script then opens `notes.json`, `summary.md`, and numbered cover files in write mode. Existing files with those names are truncated and overwritten. The vulnerability does not permit unrestricted filename selection, because the final filenames are fixed by the script. It does, however, permit selection of the containing directory and consequently overwrite of those fixed filenames anywhere writable by the invoking account. ### Attack Path 1. An attacker influences the value supplied as the output-directory argument. 2. The attacker suppl ...[truncated 996 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/fetch_xhs.py:102
Finding

Remote API Responses Can Trigger Unrestricted Cover URL Requests

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:48
Finding

Mutable External Font Download Lacks Integrity Verification

Content
View full analysis
Remediation
View remediation
/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf" echo " scripts/fonts/NotoSansSC.ttf" | sha256sum --check - ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (20)

Tainted flow: 'req' from os.environ (line 18, 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.py (reported line 26)May include surrounding context.

python
last = None
    for attempt in range(4):
        try:
            with urllib.request.urlopen(req, timeout=60) as r:
                return json.load(r)
        except Exception as e:
            last = e

Tainted flow: 'req' from os.environ (line 18, 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.py (reported line 107)May include surrounding context.

python
continue
        try:
            req = urllib.request.Request(n["cover"], headers={"User-Agent": "Mozilla/5.0"})
            data = urllib.request.urlopen(req, timeout=30).read()
            ext = ".webp" if "webp" in n["cover"] else ".jpg"
            open(os.path.join(outdir, "covers", f"{i:02d}{ext}"), "wb").write(data)
        except Exception as e:

Tainted flow: 'req' from os.environ (line 38, 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/ofox_gen.py (reported line 33)May include surrounding context.

python
"Authorization": f"Bearer {KEY}",
        "Content-Type": f"multipart/form-data; boundary={boundary}",
    })
    with urllib.request.urlopen(req, timeout=300) as r:
        return json.load(r)

Tainted flow: 'req' from os.environ (line 38, 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/ofox_gen.py (reported line 40)May include surrounding context.

python
"Authorization": f"Bearer {KEY}",
        "Content-Type": f"multipart/form-data; boundary={boundary}",
    })
    with urllib.request.urlopen(req, timeout=300) as r:
        return json.load(r)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims broad matrix-account generation behavior but omits that it depends on an external image API and undeclared capabilities. Misrepresenting third-party processing and operational scope is dangerous because users may submit product and face images without understanding that they are being sent off-platform, which is especially sensitive in a workflow centered on identity-consistent persona generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims broad matrix-account generation behavior but omits that it depends on an external image API and undeclared capabilities. Misrepresenting third-party processing and operational scope is dangerous because users may submit product and face images without understanding that they are being sent off-platform, which is especially sensitive in a workflow centered on identity-consistent persona generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

The skill claims broad matrix-account generation behavior but omits that it depends on an external image API and undeclared capabilities. Misrepresenting third-party processing and operational scope is dangerous because users may submit product and face images without understanding that they are being sent off-platform, which is especially sensitive in a workflow centered on identity-consistent persona generation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill references environment-backed secrets and networked scripts (TIKHUB_TOKEN, OFOX_API_KEY, API endpoints, and curl) but does not declare tool scope or permissions. This creates undeclared capability exposure: an agent or reviewer may not realize the skill can access secrets and send data to third parties, increasing the risk of unreviewed outbound data flow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill is written as a prescriptive workflow for producing 小红书图文笔记 and captions in a specific Chinese-platform style, but it does not offer any opt-in or alternative language/locale behavior. Under the policy, forcing a specific language or locale without user choice is a natural-language policy violation unless clearly justified as a region-specific tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow explicitly involves collecting real account content and sending images/data to third-party services, yet it does not present a clear warning or informed-consent notice. That omission is dangerous because users may unknowingly process personal images, scraped account data, or product assets through external APIs, creating privacy, compliance, and confidentiality exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire document is written as prescriptive operational guidance in Chinese, with no indication that users may choose another language or locale. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

The file instructs operators to send images and prompts to third-party services such as Ofox and Google Gemini, which creates an external data-transfer path for potentially sensitive product or user-provided images. In the context of a bulk content-generation skill, this is more dangerous because uploads may include proprietary product assets, benchmark-account data, or other business-sensitive materials without any mention of consent, minimization, or vendor review.

Content

Scanner excerpt · references/lessons.md (reported line 4)May include surrounding context.

md
# 血泪经验(踩过的坑 + 解法)

## 出图通道
- **OpenRouter 的图像模型常"not available in your region"**(image2/gpt-5-image/gemini 全中)→ 用 **Ofox**:`https://api.ofox.ai/v1/images/generations`(文生图)、`/v1/images/edits`(图生图,multipart,`image[]` 可多张)。模型 `openai/gpt-image-2`。key `sk-of-…` 放 `OFOX_API_KEY`。
- **直连 Google Gemini**(`generativelanguage.googleapis.com`,GEMINI_API_KEY)可作兜底,但效果不如 image2。
- 并发别太高(3 左右),Ofox 易 `SSL UNEXPECTED_EOF`;**必须带重试**(ofox_gen.py 已内置)。

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown file is entirely framed as a Chinese blogging/style template and includes explicit Chinese-language copy formulas and tone guidance, such as Chinese title structures and Chinese colloquial phrasing. Because it prescribes a specific language/locale for output without any opt-in or alternative, it matches the policy category for forced language or locale constraints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code reads TIKHUB_TOKEN directly from the environment, which is a sensitive credential access. While the module docstring shows how to set the variable, it does not explicitly warn that the script consumes a secret token or provide any user-facing disclosure at the point of use.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/fetch_xhs.py (reported line 13)May include surrounding context.

python
import os, sys, json, time, urllib.request, urllib.parse

TOKEN = os.environ["TIKHUB_TOKEN"]
BASE = "https://api.tikhub.io/api/v1/xiaohongshu/app_v2"


def api_get(path, **params):

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script sends the provided user_id to a third-party API and later downloads cover images from remote URLs. Although network access is inherent to the script's purpose, there is no explicit warning that user-provided identifiers and retrieved resource URLs will be sent to external services.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/ofox_gen.py (reported line 14)May include surrounding context.

python
import os, sys, json, base64, mimetypes, uuid, time, urllib.request, urllib.error

KEY = os.environ["OFOX_API_KEY"]
BASE = "https://api.ofox.ai/v1"
MODEL = "openai/gpt-image-2"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

When reference images are provided, the script uploads them to a third-party API for image editing, but the script does not clearly disclose this behavior at runtime. In this skill's context, users may supply product photos or model images that could contain personal, proprietary, or sensitive content, so silent third-party transfer creates a meaningful privacy and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file's natural-language interface, usage text, output filenames, and generated summary content are all fixed in Chinese, with no opt-in or alternative locale. This can violate language/locale policy when a skill imposes a specific language without offering user choice or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The code accesses a sensitive environment variable, OFOX_API_KEY, and uses it in Authorization headers for outbound requests. There is no visible warning or explanatory comment in the code indicating that credentials are required and will be used for external API calls.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.