Back to skill

Security audit

xhs-content-creator

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent for generating and posting Xiaohongshu drafts, but it uses persistent browser login state, public-posting automation, sensitive audit logs, and unsafe local configuration handling that users should review before installing.

Install only if you are comfortable with an agent controlling a logged-in Xiaohongshu browser profile and saving drafts or publishing on your behalf. Keep the default draft path, require explicit confirmation before publish mode, protect runtime/ and browser-profile/ as private session data, avoid using .env unless it is owned and writable only by you, and prefer pinned dependencies before production use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unbounded Third-Party Dependency Installation

Content
View full analysis
=1.44 requests>=2.31 ``` `deploy/bootstrap_project.sh:23-27`: ```bash echo "[project] installing python dependencies" "${PROJECT_ROOT}/.venv/bin/pip" install --upgrade pip "${PROJECT_ROOT}/.venv/bin/pip" install -r "${PROJECT_ROOT}/requirements.txt" echo "[project] installing playwright chromium into this project environment" "${PROJECT_ROOT}/.venv/bin/python" -m playwright install chromium ``` ### Technical Analysis The dependency constraints specify only minimum versions. Consequently, every installation may retrieve different future releases of Playwright, Requests, and their transitive dependencies. The bootstrap script also upgrades pip without pinning its version and dynamically downloads a Playwright-managed Chromium artifact. This prevents the reviewed source tree from defining a reproducible dependency set. A compromised package release, poisoned transitive dependency, malicious registry response, or incompatible future package can become part of the effective executable payload after the Skill has already been reviewed. No evidence of a currently malicious package or dependency-confusion package name was found. The risk arises from uncontrolled future dependency and browser-artifact resolution. ### Attack Path 1. An attacker compromises a permitted future version of a direct or transitive dependency, or the distribution channel used for a Playwright browser artifact. 2. An administrator or agent invokes `deploy/bootstrap_project.sh`. 3. The minimum-only constraints permit pip to select the compromised release. 4. Package installation code, imported package code, or the downloaded browser executes under ...[truncated 799 chars]
Remediation
View remediation
` and `requests==`. 2. Generate a lock file containing all transitive dependencies and require hashes, such as with `pip-compile --generate-hashes`. 3. Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Remove the unconditional pip upgrade or pin pip to a reviewed version. 5. Pin the Playwright version and browser revision as a tested pair. 6. Download browser artifacts only from an approved source and verify their integrity where the deployment process permits it. 7. Run project bootstrap as a dedicated unprivileged account, never as root. 8. Use an internal package mirror or allowlisted package repository for production deployment. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
deploy/run_with_xvfb.sh:13
Finding

Arbitrary Shell Execution Through Sourced .env Configuration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/browser_session.py:194
Finding

Sensitive HTTP Request Bodies Persisted in Audit Logs Without Redaction

Content
View full analysis
None: try: url = str(req.url) if not is_interesting_url(url): return post_data = req.post_data if req.method.upper() in {"POST", "PUT", "PATCH"} else None self.audit.event( "request_seen", method=req.method, resource_type=req.resource_type, url=short(url, 800), post_data=short(post_data, 1200) if post_data else None, ) except Exception: pass ``` The event is persisted by `src/audit.py:24-30`: ```python payload = { "ts": datetime.now(timezone.utc).astimezone().isoformat(), "event": event, **fields, } with self.actions_path.open("a", encoding="utf-8") as fh: fh.write(json.dumps(payload, ensure_ascii=False) + "\n") ``` ### Technical Analysis The browser debug hook records request bodies for matching `POST`, `PUT`, and `PATCH` traffic. URL matching is broad and includes terms such as `publish`, `note`, `upload`, `creator`, `draft`, `web_api`, and `api/sns`. Request data is truncated but not structurally parsed or redacted before being written to `actions.jsonl`. Publishing API bodies may contain unpublished content, account or note identifiers, upload metadata, anti-CSRF values, signed request parameters, or other security-sensitive fields. Truncation does not provide confidentiality because sensitive values may appear near the beginning of a request. The log writer creates files without explicitly enforcing res ...[truncated 1454 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Note
Location
docs/cloud_deploy.md:123
Finding

Host-Wide Privileged OpenClaw Service Modification Exceeds One-Shot Publishing Requirements

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (86)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared description promises an end-to-end content workflow centered on Feishu image intake, AI analysis, copy generation, and Xiaohongshu publishing. The provided code chunk does not implement that workflow; it only prepares the local runtime environment and browser automation dependencies. While setup scripts can support the broader skill, this specific chunk’s actual behavior is materially different from the declared purpose and does not itself perform the claimed functions. Therefore this chunk does not accurately represent the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description claims an end-to-end creation workflow including upstream image intake from Feishu DM and AI content generation based on image analysis. This code chunk explicitly states it 'does NOT generate content' and expects the calling agent to provide title/body/topics. Its implemented functions are limited to argument parsing, copying image files into a runtime folder, writing my_content.json, validating title length/image count, optionally reusing an existing JSON, and shelling out to a publishing pipeline with retries. That is materially narrower and different from the declared purpose, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description emphasizes a full pipeline starting from Feishu DM image receipt and AI-based content generation from image mood, ending in Xiaohongshu posting. The supplied code chunk only implements the publishing/execution portion: it accepts a --content JSON file, validates/normalizes it, applies duplicate/frequency guard logic, manages browser/login session state, invokes an XhsPublisher, records audit artifacts, and optionally records a successful publish. Those are consistent with a publishing backend, but the upstream intake and generation capabilities described are absent from this code. Additionally, the code includes operational behaviors like audit logging, cloud notification, login cache handling, and duplicate protection that are not mentioned in the declared purpose. This is a material description-behavior mismatch because the declared primary purpose is an end-to-end creative pipeline, while the actual chunk is a content publishing CLI for already-prepared content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是“端到端自动发布/内容生成”型 skill,核心能力应包括输入采集、图片分析、文案生成和发布流程。而代码片段实际仅是 validate_content.py 校验器:通过命令行或 stdin 读取 title/body/topics/images,检查字数、段落数、关键词位置、禁用词、话题格式、图片数量/大小/扩展名等规则,并返回 JSON 违规结果与退出码。它没有任何飞书集成、模型分析、生成逻辑,也没有发布到小红书的行为。虽然校验规则与描述中提到的“内容创作宪法”相关,属于该类系统的配套组件,但就这段代码本身而言,其主要目的与声明的主要功能明显不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a concrete end-to-end workflow including Feishu DM intake, image analysis, and content generation for Xiaohongshu. The supplied code does not implement any of these behaviors; it only defines a package-level docstring. This is a material description-versus-behavior mismatch because the actual code chunk lacks the stated primary functionality. No undeclared capabilities are present, but the declared purpose is not substantiated by the code shown.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description focuses on content ingestion from Feishu, image atmosphere analysis, and generation of Xiaohongshu post text and topics. The supplied code does not implement any of those behaviors. Instead, it provides generic audit infrastructure for browser automation or web sessions, including screenshot capture, DOM snapshotting, and event logging to files. These are materially different capabilities and represent a different primary purpose than the declared end-to-end publishing/generation workflow.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description emphasizes a business workflow for ingesting images from Feishu, analyzing them, and generating Xiaohongshu post content. This code chunk does not implement any of those core functions. Instead, it provides low-level browser automation infrastructure plus stealth features to evade automation detection and audit hooks to inspect network activity related to publishing. Those are materially different capabilities and are not disclosed in the description. While such browser support code could be part of a larger publishing system, this specific chunk’s behavior is not accurately represented by the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk does not perform the declared core workflow of receiving images, analyzing atmosphere, or generating Xiaohongshu title/body/hashtags. Instead, it writes a notification payload file containing a login QR screenshot path, delivery instructions, and Feishu-group messaging metadata for a user-scannable login step. That is a materially different purpose and capability from the declared content-generation/publishing description, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents an end-to-end automation skill centered on ingesting images from Feishu, analyzing them, and generating Xiaohongshu post content according to specific writing rules. The supplied code does not implement those core behaviors. Instead, it is a content validation utility that parses a JSON file, validates field presence/lengths, normalizes topics, resolves image paths on disk, checks file existence/types, and computes a fingerprint. While this may be a supporting component in a larger publishing pipeline, by itself it materially differs from the declared primary purpose and omits the headline capabilities described.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description focuses on content workflow capabilities: receiving images from Feishu DM, analyzing image atmosphere, and generating Xiaohongshu post text (title/body/topics). The supplied code does none of those things. Instead, it provides low-level browser automation behavior designed to mimic human interaction and reduce detection during Playwright sessions, including randomized delays, bezier-style mouse movement, wheel scrolling, and visiting Xiaohongshu's homepage before a publish action. These are materially different capabilities and introduce an undeclared stealth/anti-detection function, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description focuses on a content-creation and publishing workflow for Xiaohongshu, including Feishu DM image intake, image atmosphere analysis, and generation of title/body/topics. The supplied code does not implement any of those functions. Instead, it provides low-level browser automation helpers for locating page elements and interacting with them. While such utilities could be supporting infrastructure in a larger posting system, this chunk’s actual behavior is materially different from the declared purpose and introduces undeclared UI automation capabilities. Therefore this code chunk does not accurately represent the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a full content automation workflow for Xiaohongshu, including receiving images from Feishu, analyzing them, generating copy, and posting. The supplied code chunk does none of these things. Instead, it manages cached login state in a local JSON file for a Xiaohongshu account, including expiration handling and invalidation. While login-state management could be a supporting component of a posting system, this chunk’s actual purpose is materially different from the declared end-to-end content publishing workflow, and it introduces an undeclared capability (persistent authentication state management). Therefore this code chunk does not accurately represent the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description presents a broader end-to-end workflow that starts with Feishu DM image intake, performs image atmosphere analysis, and generates Xiaohongshu copy under specific writing constraints. This code chunk does none of those creative or intake steps. Instead, it is a browser automation publisher module focused on login handling, upload, form filling, draft saving, and publishing. It also contains an undeclared QR login handoff/notification path and audit screenshot/DOM capture behavior. While publishing is consistent with part of the declared workflow, the supplied code materially underdelivers on the stated primary capabilities and adds operational capabilities not mentioned in the description, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description describes a content-creation and publishing pipeline for Xiaohongshu driven by Feishu image intake and AI copy generation. The supplied code does none of that. Instead, it is a verification script for a browser automation session, specifically checking whether browser fingerprints and Playwright/automation traces are hidden. This is a materially different primary purpose and introduces an undeclared capability: stealth/anti-detection browser testing. Therefore the description does not accurately represent the actual code behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about an end-to-end Xiaohongshu content automation pipeline involving message intake, image understanding, and content generation. The supplied code chunk does none of those things. It is a test file for an audit log utility, focused on filesystem directory creation, JSON/JSONL writing, event recording, and timestamp formatting. This is a materially different primary purpose and capability set from the declared skill behavior, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a production workflow skill that ingests images from Feishu, analyzes them, then generates Xiaohongshu post content. The actual code chunk does none of that. It is only a test module validating content-policy/compliance rules in helper functions such as check_title, check_body, check_topics, check_images, and validate. While these rules may support the described content constitution, this chunk’s actual purpose is regression testing of validators, not end-to-end content creation or publishing. Therefore the code behavior is materially different from the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description centers on content ingestion and generation for Xiaohongshu posts: receiving images from Feishu DM, analyzing image atmosphere, and generating titles,正文, and topics. The supplied code does none of that. Instead, it tests a duplicate-publish guard that checks fingerprints, enforces a time window between publishes, and persists history to published_history.json in a runtime directory. This is a materially different purpose, not merely a supporting detail of the described generation pipeline. Therefore the description does not accurately represent the actual code behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a content automation workflow for Xiaohongshu publishing, involving message intake, image analysis, and copy generation. The supplied code does none of that. It is strictly a test file validating path-handling bugs and directory resolution logic in local filesystem/cloud notification helpers. This is a materially different primary purpose and unrelated functionality, so the description does not accurately represent the code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description focuses on an end-to-end content creation and publishing workflow: ingesting images from Feishu DM, analyzing image atmosphere, and generating Xiaohongshu title/body/topics. The supplied code does none of that. It is a test module for draft-mode save functionality in a Xiaohongshu publisher, checking selector configuration and existence of publisher methods. While draft saving may be adjacent to a publishing system, this chunk’s primary purpose is regression testing of UI automation behavior, not content analysis/generation or Feishu-driven ingestion. Therefore the code behavior is materially different from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description describes a full workflow for receiving images, analyzing them, and generating/posting Xiaohongshu content. The supplied code does none of that. It is strictly a test module for a helper function title_len_xhs, focused on character-count semantics and regression cases for title length limits. While title-length validation could be a supporting detail within a larger content-generation system, this chunk by itself does not implement the declared end-to-end publishing behavior and instead serves a materially different primary purpose: unit testing a validation rule.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
LOGIN_TIMEOUT="${LOGIN_TIMEOUT:-300}"
DISPLAY_NUM="${DISPLAY_NUM:-99}"

# Optional .env at PROJECT_ROOT (still respected if present for back-compat,
# but the caller in generate_and_publish.py already passes MODE explicitly).
if [ -f "${PROJECT_ROOT}/.env" ]; then
  # shellcheck disable=SC1091

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 89)May include surrounding context.

md
LOGIN_TIMEOUT="${LOGIN_TIMEOUT:-300}"
DISPLAY_NUM="${DISPLAY_NUM:-99}"

# Optional .env at PROJECT_ROOT (still respected if present for back-compat,
# but the caller in generate_and_publish.py already passes MODE explicitly).
if [ -f "${PROJECT_ROOT}/.env" ]; then
  # shellcheck disable=SC1091

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 90)May include surrounding context.

md
LOGIN_TIMEOUT="${LOGIN_TIMEOUT:-300}"
DISPLAY_NUM="${DISPLAY_NUM:-99}"

# Optional .env at PROJECT_ROOT (still respected if present for back-compat,
# but the caller in generate_and_publish.py already passes MODE explicitly).
if [ -f "${PROJECT_ROOT}/.env" ]; then
  # shellcheck disable=SC1091

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · deploy/run_with_xvfb.sh (reported line 13)May include surrounding context.

sh
LOGIN_TIMEOUT="${LOGIN_TIMEOUT:-300}"
DISPLAY_NUM="${DISPLAY_NUM:-99}"

# Optional .env at PROJECT_ROOT (still respected if present for back-compat,
# but the caller in generate_and_publish.py already passes MODE explicitly).
if [ -f "${PROJECT_ROOT}/.env" ]; then
  # shellcheck disable=SC1091

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/cloud_deploy.md (reported line 151)May include surrounding context.

md
LOGIN_TIMEOUT="${LOGIN_TIMEOUT:-300}"
DISPLAY_NUM="${DISPLAY_NUM:-99}"

# Optional .env at PROJECT_ROOT (still respected if present for back-compat,
# but the caller in generate_and_publish.py already passes MODE explicitly).
if [ -f "${PROJECT_ROOT}/.env" ]; then
  # shellcheck disable=SC1091

Static analysis

No suspicious patterns detected.