Back to skill

Security audit

xiaohongshu-cover-gen

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real image-generation workflow, but it handles Lovart login cookies and includes unsafe download helpers that users should review carefully.

Install only if you are comfortable giving an agent access to a Lovart session and generated-image downloads. Use a dedicated low-value Lovart account, keep cookies out of the project and source control, avoid the TLS-disabled downloader, and review or replace the shell scripts before running them.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/download_image.sh:19
Finding

JavaScript Injection Through Downloader Arguments

Content
View full analysis
{ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { console.log('Redirected to:', res.headers.location); return; } const chunks = []; res.on('data', c => chunks.push(c)); res.on('end', () => { const buf = Buffer.concat(chunks); fs.writeFileSync('$OUTPUT', buf); console.log('Download complete:', (buf.length / 1024).toFixed(1), 'KB'); }); ``` ### Technical Analysis The first and second shell arguments are interpolated directly into JavaScript source passed to `node -e`. Neither value is encoded or passed through a separate argument channel. A URL or output path containing a single quote can terminate the JavaScript string literal. Additional JavaScript can then be inserted into the generated program. Node.js code executed in this context has access to the filesystem, network, environment variables, and process-spawning APIs available to the current user. The output path is also unrestricted. Even without JavaScript injection, the script can write downloaded bytes to any path writable by the invoking user. The script does not constrain output to a dedicated directory or validate the downloaded content as an image. ### Attack Path ...[truncated 1092 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/check_jwt.sh:6
Finding

JavaScript Injection Through the Cookie Filename

Content
View full analysis
c.name === 'usertoken'); if (!token) { console.log('usertoken cookie not found'); process.exit(1); } try { const payload = JSON.parse(Buffer.from(token.value.split('.')[1], 'base64').toString()); const exp = new Date(payload.exp * 1000); const now = new Date(); const hoursLeft = (exp - now) / 3600000; console.log('Cookies file:', '$COOKIES_FILE'); console.log('JWT expiration time:', exp.toISOString()); console.log('Remaining time:', hoursLeft.toFixed(1), 'hours'); if (hoursLeft <= 0) { console.log('JWT expired'); process.exit(1); } else if (hoursLeft <= 24) { console.log('JWT expires within 24 hours'); } else { console.log('JWT is valid'); } } catch (e) { console.log('JWT parsing failed:', e.message); process.exit(1); } " ``` ### Technical Analysis The caller-controlled cookie filename is inserted into JavaScript source in both `fs.readFileSync(...)` and `console.log(...)`. Shell quoting does not make the resulting JavaScript safe. A specially constructed existing filename containing a single quote and JavaScript syntax can terminate the intended string literal. The injected expression is then parsed and executed by Node.js. The preliminary `-f` check does not prevent exploitation because files can legally contain quote characters and other JavaScript-significant characters in their names. JWT payload decoding is not itself ...[truncated 1162 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/download_image.sh:31
Finding

TLS Certificate Verification Is Disabled for Image Downloads

Content
View full analysis
{ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { console.log('Redirected to:', res.headers.location); return; } const chunks = []; res.on('data', c => chunks.push(c)); res.on('end', () => { const buf = Buffer.concat(chunks); fs.writeFileSync('$OUTPUT', buf); console.log('Download complete:', (buf.length / 1024).toFixed(1), 'KB'); }); ``` The operational guide repeats the same unsafe pattern: ```bash NODE_TLS_REJECT_UNAUTHORIZED=0 node -e " const https = require('https'); const fs = require('fs'); const url = ''; https.get(url, {rejectUnauthorized: false}, res => { const chunks = []; res.on('data', c => chunks.push(c)); res.on('end', () => { fs.writeFileSync('', Buffer.concat(chunks)); }); }); " ``` ### Technical Analysis TLS verification is disabled in two independent ways: - `NODE_TLS_REJECT_UNAUTHORIZED=0` disables certificate verification for the Node.js process. - `{rejectUnauthorized: false}` disables it for the individual HTTPS request. The script also accepts ordinary HTTP and does not restrict the destination to Lovart. Consequently, it cannot establish the identity of the remote server or guarantee response integrity. A network attacker can impersonate the intended image host and substitute arbitrary content. The response is buffered and written without checki ...[truncated 1414 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/lovart-operation.md:13
Finding

Reusable Lovart Session Cookies Are Stored and Injected Insecurely

Content
View full analysis
; path=/; secure; SameSite=Lax'; document.cookie='useruuid=; path=/; secure; SameSite=Lax'; document.cookie='webid=; path=/; secure; SameSite=Lax'" ``` The README similarly instructs users to store the credentials locally: ```text 1. Register a Lovart account. 2. Export usertoken, useruuid, and webid through browser DevTools. 3. Save them as .lovart_cookies.json. ``` ### Technical Analysis The Skill instructs users to export a reusable authenticated session token and save it in a plaintext JSON file. It does not require restrictive filesystem permissions, storage outside the project, a secret manager, secure deletion, or verification that the file is excluded from version control. The README's displayed directory structure refers to a `.gitignore`, but no `.gitignore` was present in the audited artifact. Users may therefore assume the credential file is protected from commits when that protection is not actually supplied. The fallback mechanism places token values directly in an `agent-browser eval` command and creates cookies through `document.cookie`. Such cookies are necessarily accessible to JavaSc ...[truncated 1418 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
README.md:65
Finding

Pillow Is Installed Without Version or Integrity Pinning

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (22)

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

�),Agent 会自动按照 Skill 中定义的流程工作。

触发词:小红书配图、封面生成、图卡设计、XHS cover、social media image

2. 首次使用前准备

Lovart 账号(生成封面图)

  1. 注册 Lovart 账号
  2. 在浏览器 DevTools 中导出 3 个关键 cookies:usertoken、useruuid、webid
  3. 保存为 .lovart_cookies.json(格式见 references/lovart-operation.md)

Python 环境(生成文字图卡)

bash
pip install Pillow

3. 工作流概览

text
收到帖子内容
    ↓
阶段 0:精准调研(10min)— Dribbble + 小红书 + 品牌官网
    ↓
阶段 1:帖子分析 → 配图方案
    ↓
阶段 2:方案确认 + 素材需求前置
    ↓
阶段 3:写 prompt(过 8 项自检)
    ↓
阶段 4:Lovart 生成 / Python 图卡
    ↓
阶段 5:整合检查

🛠️ 前置依赖

依赖用途必需?
[Lov

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s stated function is social-media image creation, but the behavior includes downloading arbitrary remote files, writing them locally, and bypassing TLS certificate validation. That mismatch is dangerous because it turns a design assistant into a general-purpose network/file operation path that can enable malicious content retrieval, MITM exposure, and unsafe file writes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s stated function is social-media image creation, but the behavior includes downloading arbitrary remote files, writing them locally, and bypassing TLS certificate validation. That mismatch is dangerous because it turns a design assistant into a general-purpose network/file operation path that can enable malicious content retrieval, MITM exposure, and unsafe file writes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document explicitly instructs operators to extract and reuse Lovart authentication cookies, including a JWT bearer token, to impersonate an authenticated browser session. That creates credential handling and session hijacking risk far beyond a normal image-generation skill, and the skill context does not justify collecting or replaying third-party auth artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions expose highly sensitive session material by telling users to retrieve and persist usertoken, useruuid, and webid values, but provide no warning about credential theft, account takeover, or secure storage. In practice, these values can grant authenticated access and should be treated as secrets.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The download guidance disables TLS certificate validation globally for the Node process and also sets rejectUnauthorized to false, allowing man-in-the-middle interception or silent retrieval of tampered content. This is an unsafe network bypass unrelated to the stated purpose of generating social media images.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs operators to bypass TLS verification without any warning that doing so defeats server identity checks and permits interception or tampering. Presenting this as a recommended workaround normalizes dangerous behavior that can compromise downloaded artifacts and surrounding systems.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/lovart-operation.md (reported line 256)May include surrounding context.

md
agent-browser eval "window._imgData.split(',')[1].length"
# 假设 7000000,分 14 块

rm -f /tmp/lovart_b64.txt
for i in $(seq 0 13); do
  START=$((i * 500000))
  END=$(((i + 1) * 500000))

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README explicitly instructs users to export active authentication cookies from browser DevTools and store them locally, but provides no warning that these values are bearer secrets equivalent to session credentials. If mishandled, leaked, committed to source control, or reused by other tools, an attacker could hijack the Lovart session and access or act as the user.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill advertises browser automation and auxiliary Python/Node-style operational work, but it declares no explicit tool scope or permission boundaries. In practice this can cause an agent to invoke shell-capable actions without least-privilege constraints, increasing the chance of unintended local file access, network activity, or execution of unsafe helper commands.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger conditions are broad enough that the skill may activate for many generic image or social-media requests without clear boundaries. Over-broad activation is risky here because the skill includes browsing, downloading, and session-related behavior that users may not expect from a simple cover-generation request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs browser automation, website research, cookie/session workarounds, and file downloads without clearly warning users that it may access remote services, manipulate sessions, and write files locally. This lack of transparency undermines informed consent and increases privacy and account-security risk, especially given the Lovart and browsing workflow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill recommends direct cookie injection and JWT-related browser session manipulation to work around automation issues. These techniques expand the skill from content creation into sensitive session handling, increasing the risk of credential misuse, accidental leakage, and operation under a user identity without clear consent or safeguards.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The guidance to use Node.js with rejectUnauthorized:false explicitly disables certificate validation for downloads. This makes HTTPS protections ineffective, allowing man-in-the-middle interception or substitution of downloaded image content and exposing the agent to tampered files or attacker-controlled payloads.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all instructions and guidance exclusively in Chinese, which can amount to a language/locale policy violation when no user opt-in or justification is provided. The policy for this audit requires flagging cases where a skill forces a specific language without offering a choice.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

Setting NODE_TLS_REJECT_UNAUTHORIZED=0 changes Node's default security posture to accept invalid certificates, which can affect the entire process and any HTTPS requests it makes. This unsafe default materially increases exposure to interception and content spoofing.

Content

Scanner excerpt · references/lovart-operation.md (reported line 220)May include surrounding context.

✅ 用 Node.js 下载:

bash
NODE_TLS_REJECT_UNAUTHORIZED=0 node -e "
const https = require('https');
const fs = require('fs');
const url = '<IMAGE_URL>';

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file title and instructions are written as a mandatory pre-send checklist in Chinese, and L03 states prompts must be reviewed this way every time before sending. Under the policy, forcing a specific language or locale without user opt-in can be a natural-language policy violation; there is no indication that users may choose another language or that the constraint is region-specific and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script explicitly disables TLS certificate validation via both NODE_TLS_REJECT_UNAUTHORIZED=0 and rejectUnauthorized: false, allowing HTTPS downloads to proceed without authenticating the remote server. This enables man-in-the-middle interception or substitution of downloaded images, which is especially risky because the file is saved directly to a user-specified path with no integrity verification or warning.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

Setting NODE_TLS_REJECT_UNAUTHORIZED=0 creates an unsafe default for the entire Node.js process, causing all TLS connections in that invocation to skip certificate verification. In a download utility, this defeats HTTPS security guarantees and makes silent content tampering feasible on untrusted networks or through compromised intermediaries.

Content

Scanner excerpt · scripts/download_image.sh (reported line 31)May include surrounding context.

sh
# 确保输出目录存在
mkdir -p "$(dirname "$OUTPUT")"

NODE_TLS_REJECT_UNAUTHORIZED=0 node -e "
const https = require('https');
const http = require('http');
const fs = require('fs');

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The template hardcodes Chinese and English font slots, and the recommended font section centers Chinese-specific defaults. This imposes a language/locale assumption in the skill content without any opt-in or indication that the template is only for Chinese-language output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The instruction "关键词必须用英文" forces a specific language choice in the skill guidance. Under the policy, language constraints should either be optional for the user or clearly justified as a region- or tool-specific requirement; this line presents it as a blanket requirement without such framing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language comments and console messages are entirely in Chinese, which imposes a specific language on users. Under the policy rule, locale or language restrictions should either offer user opt-in/choice or be clearly justified as region-specific, neither of which is present here.

Content

No source excerpt is available for this finding.