Back to skill

Security audit

Auto Redbook Skills

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it says, but its publishing mode handles a live social-media login cookie and can send it to a configurable API service, so it needs review before install.

Install only if you are comfortable giving the skill a Xiaohongshu login cookie and allowing it to publish under that account. Avoid API mode unless the API service is local and trusted, keep the cookie out of prompts and shared files, rotate/revoke it if exposed, and render only Markdown from trusted sources or in an isolated environment.

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)

other

Error
Location
scripts/publish_xhs.py:205
Finding

Authenticated Session Cookie Disclosure to an Arbitrary API Endpoint

Content
View full analysis
str: """Get the API service address.""" return os.getenv('XHS_API_URL', 'http://localhost:5005') ``` ```python class ApiPublisher: """API publishing mode.""" def __init__(self, cookie: str, api_url: str = None): self.cookie = cookie self.api_url = api_url or get_api_url() self.session_id = 'md2redbook_session' def init_client(self): print(f"Connecting to API service: {self.api_url}") try: resp = requests.get(f"{self.api_url}/health", timeout=5) if resp.status_code != 200: raise Exception("API service unavailable") except requests.exceptions.RequestException as e: print(f"Unable to connect to API service: {e}") sys.exit(1) try: resp = requests.post( f"{self.api_url}/init", json={ "session_id": self.session_id, "cookie": self.cookie }, timeout=30 ) result = resp.json() ``` ```python parser.add_argument( '--api-url', default=None, help='API service address' ) if args.api_mode: publisher = ApiPublisher(cookie, args.api_url) else: publisher = LocalPublisher(cookie) ``` ### Technical Analysis The publishing script reads the complete `XHS_COOKIE` value, which includes authentication fields such as `web_session`, and sends it in plaintext JSON to the endpoint selected through `--api-url` or `XHS_API_URL`. The destination is not restricted to localhost or an approved hostname. The code performs no URL scheme validation, host ...[truncated 1751 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/render_xhs.py:105
Finding

Unsanitized Markdown and Metadata Executed in a Network-Enabled Browser

Content
View full analysis
str: """Convert Markdown to HTML.""" tags_pattern = r'((?:#[\w\u4e00-\u9fa5]+\s*)+)$' tags_match = re.search(tags_pattern, md_content, re.MULTILINE) tags_html = "" if tags_match: tags_str = tags_match.group(1) md_content = md_content[:tags_match.start()].strip() tags = re.findall(r'#([\w\u4e00-\u9fa5]+)', tags_str) if tags: tags_html = '
' for tag in tags: tags_html += f'#{tag}' tags_html += '
' html = markdown.markdown( md_content, extensions=['extra', 'codehilite', 'tables', 'nl2br'] ) return html + tags_html ``` ```python def generate_card_html(content: str, theme: str, page_number: int = 1, total_pages: int = 1, width: int = DEFAULT_WIDTH, height: int = DEFAULT_HEIGHT, mode: str = 'separator') -> str: html_content = convert_markdown_to_html(content) # The returned document directly embeds html_content. return f''' ...
{html_content}
... ''' ``` ```python async def render_html_to_image(html_content: str, output_path: str, width: int = DEFAULT_WIDTH, height: int = DEFAULT_HEIGHT, mode: str = 'separator', ...[truncated 3754 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:4
Finding

Security-Sensitive Dependencies Are Not Reproducibly Pinned

Content
View full analysis
=3.4.0 PyYAML>=6.0 playwright>=1.40.0 xhs>=0.4.0 python-dotenv>=1.0.0 requests>=2.28.0 ``` ```json "dependencies": { "js-yaml": "^4.1.0", "marked": "^11.0.0", "playwright": "^1.58.0" } ``` The Skill documentation also recommends installing the credential-handling package without a version constraint: ```bash pip install xhs ``` ### Technical Analysis The Python requirements use lower bounds with no upper bounds, exact versions, or package hashes. The npm dependencies use caret ranges, and no reviewed lockfile appears in the project structure. Consequently, installing the Skill at different times can resolve different package versions. This is particularly sensitive because: - The `xhs` package receives the complete authenticated account cookie. - Playwright installs and executes a browser binary. - Markdown parsers process potentially hostile input. - Dependency code executes with the user's local process privileges. This finding does not establish that the named packages are currently malicious. The vulnerability is the absence of reproducible, integrity-verified dependency resolution for security-sensitive components. ### Attack Path 1. A user follows the documented `pip install` or `npm install` instructions. 2. The package manager resolves versions available at installation time rather than a fixed reviewed dependency set. 3. A compromised future release, compromised package account, malicious transitive dependency, or newly introduced vulnerable version is selected. 4. The dependency executes during installation or application runtime. 5. Because the publishing process handles `XHS_COOKIE`, malicious dependency code could read and disclose account credentials, alter publish ...[truncated 799 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (71)

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The skill explicitly instructs users to copy authentication cookies into a local .env file so the publishing script can act as the user's Xiaohongshu account. Session cookies are highly sensitive bearer credentials; if the skill, related scripts, logs, or the host environment are compromised, an attacker could hijack the account and publish content or access account-scoped data.

Content

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

1. 配置 Cookie

bash
cp env.example.txt .env

编辑 .env:

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior claims content creation and publishing, but the referenced implementation reportedly also reads XHS_COOKIE and performs external API interactions that are not transparently declared as sensitive actions. This mismatch is dangerous because users and orchestrators may treat the skill as a harmless content-creation helper when it can actually consume account credentials and send data off-box.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented behavior claims content creation and publishing, but the referenced implementation reportedly also reads XHS_COOKIE and performs external API interactions that are not transparently declared as sensitive actions. This mismatch is dangerous because users and orchestrators may treat the skill as a harmless content-creation helper when it can actually consume account credentials and send data off-box.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented behavior claims content creation and publishing, but the referenced implementation reportedly also reads XHS_COOKIE and performs external API interactions that are not transparently declared as sensitive actions. This mismatch is dangerous because users and orchestrators may treat the skill as a harmless content-creation helper when it can actually consume account credentials and send data off-box.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior claims content creation and publishing, but the referenced implementation reportedly also reads XHS_COOKIE and performs external API interactions that are not transparently declared as sensitive actions. This mismatch is dangerous because users and orchestrators may treat the skill as a harmless content-creation helper when it can actually consume account credentials and send data off-box.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented behavior claims content creation and publishing, but the referenced implementation reportedly also reads XHS_COOKIE and performs external API interactions that are not transparently declared as sensitive actions. This mismatch is dangerous because users and orchestrators may treat the skill as a harmless content-creation helper when it can actually consume account credentials and send data off-box.

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 155)May include surrounding context.

md
node scripts/render_xhs.js content.md -t default -m separator

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/render_xhs.js content.md -t default -m separator

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The file explicitly instructs users to copy a live Xiaohongshu session cookie into a local .env file. A session cookie is an authentication credential, so this workflow encourages handling long-lived login tokens outside the browser and increases the chance of accidental disclosure through local compromise, logs, backups, screenshots, or mistaken commits. In this skill's context, the cookie appears intended to enable automated posting, which makes the credential highly sensitive because theft would allow account takeover or unauthorized actions on the user's behalf.

Content

Scanner excerpt · env.example.txt (reported line 2)May include surrounding context.

text
# 小红书 Cookie 配置
# 将此文件复制为 .env 并填入真实的 Cookie
#
# 获取方式:
# 1. 在浏览器中登录小红书 (https://www.xiaohongshu.com)

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 · scripts/publish_xhs.py (reported line 14)May include surrounding context.

python
python publish_xhs.py --title "标题" --desc "描述" --images cover.png card_1.png --api-mode

环境变量:
    在同目录或项目根目录下创建 .env 文件,配置:
    
    # 必需:小红书 Cookie
    XHS_COOKIE=your_cookie_string_here

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 · scripts/publish_xhs.py (reported line 44)May include surrounding context.

python
python publish_xhs.py --title "标题" --desc "描述" --images cover.png card_1.png --api-mode

环境变量:
    在同目录或项目根目录下创建 .env 文件,配置:
    
    # 必需:小红书 Cookie
    XHS_COOKIE=your_cookie_string_here

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 · scripts/publish_xhs.py (reported line 45)May include surrounding context.

python
python publish_xhs.py --title "标题" --desc "描述" --images cover.png card_1.png --api-mode

环境变量:
    在同目录或项目根目录下创建 .env 文件,配置:
    
    # 必需:小红书 Cookie
    XHS_COOKIE=your_cookie_string_here

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 · scripts/publish_xhs.py (reported line 60)May include surrounding context.

python
python publish_xhs.py --title "标题" --desc "描述" --images cover.png card_1.png --api-mode

环境变量:
    在同目录或项目根目录下创建 .env 文件,配置:
    
    # 必需:小红书 Cookie
    XHS_COOKIE=your_cookie_string_here

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 · scripts/publish_xhs.py (reported line 47)May include surrounding context.

python
"""从 .env 文件加载 Cookie"""
    # 尝试从多个位置加载 .env
    env_paths = [
        Path.cwd() / '.env',
        Path(__file__).parent.parent / '.env',
        Path(__file__).parent.parent.parent / '.env',
    ]

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 · scripts/publish_xhs.py (reported line 48)May include surrounding context.

python
"""从 .env 文件加载 Cookie"""
    # 尝试从多个位置加载 .env
    env_paths = [
        Path.cwd() / '.env',
        Path(__file__).parent.parent / '.env',
        Path(__file__).parent.parent.parent / '.env',
    ]

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 · scripts/publish_xhs.py (reported line 49)May include surrounding context.

python
"""从 .env 文件加载 Cookie"""
    # 尝试从多个位置加载 .env
    env_paths = [
        Path.cwd() / '.env',
        Path(__file__).parent.parent / '.env',
        Path(__file__).parent.parent.parent / '.env',
    ]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises operational behaviors that involve reading environment secrets, accessing local files, and communicating with external services, but it declares no explicit tool scope or permission boundaries. This is dangerous because an agent could invoke credential access and networked publishing without a clear, user-visible authorization model, increasing the risk of unintended secret use or data exfiltration.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation description is broad enough to match many ordinary content-creation requests, which can cause the agent to invoke a skill with file, environment, and possible network/publishing side effects in situations where a simple text response would suffice. In this context, overbroad triggering increases the chance of unnecessary access to local content or accidental progression toward external posting.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The usage scenarios are underspecified and do not define clear boundaries for when the skill may read files, render content, or publish externally. Because this skill context includes optional credential-based publishing, weak activation constraints make unintended use materially riskier than in a purely local formatting tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The publishing instructions tell users how to send content and images to Xiaohongshu using an authenticated cookie, but they do not provide a clear warning that this transmits user content to a third party and relies on highly sensitive session credentials. This is dangerous because users may unknowingly expose private material or grant account-level posting capability without understanding the security implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes instructions for extracting browser cookies from developer tools without prominently treating them as secrets equivalent to account credentials. Exposing or mishandling such cookies can allow full account takeover or unauthorized posting, especially since the skill is explicitly designed to reuse that cookie for authenticated actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The HTML document hard-codes lang="zh-CN", which imposes a specific language/locale on all rendered content. Under the policy, locale restrictions should either be optional for the user or clearly justified as region-specific; neither is evident in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file presents the skill title, subtitle, instructions, and descriptive content exclusively in Chinese, which can amount to a language/locale policy violation if users are not given an opt-in or alternative language. The content does not state that the skill is region-specific or limited to a Chinese-language audience.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The install script invokes npx playwright install chromium, which can resolve and execute a package version at runtime rather than strictly using a locked, preapproved binary invocation path. In build or CI environments this increases supply-chain risk because an unexpected package/version could be fetched or a compromised dependency path could be executed during browser installation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The POST to /init externally transmits sensitive authentication material, including the user's cookie, to the configured API service. If that service is remote, compromised, or accessed over insecure transport, the credential can be intercepted or retained and then used to hijack the user's Xiaohongshu account session.

Content

Scanner excerpt · scripts/publish_xhs.py (reported line 227)May include surrounding context.

python
# 初始化 session
        try:
            resp = requests.post(
                f"{self.api_url}/init",
                json={
                    "session_id": self.session_id,

Static analysis

No suspicious patterns detected.