Back to skill

Security audit

text-to-elegant-image

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do text-to-image generation as described, but it should be reviewed because it installs a live npm dependency and renders local HTML with weakened browser protections.

Install only if you are comfortable with a skill that can download npm packages during setup and run headless Chrome over generated local HTML. Review or change the browser flags first, prefer pinned dependencies with a lockfile, avoid rendering untrusted HTML, and use per-run output paths instead of editing shell startup files unless you want that persistence.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:155
Finding

Mandatory Branding and Engagement Content Injected into User-Generated Images

Content
View full analysis
@ <当前模型名>` - 例:`text-to-elegant-image @ claude-4.6-sonnet` - 用户**指定了**作者信息(如"作者写张三"):写入用户指定的文字 - 用户**明确说不要 footer**:HTML 中不生成 `.footer` 元素,截图时追加 `--no-footer` 不要在 footer 中写 "Generated by <某助手名>" 或任何 AI 身份标识。 ``` The Xiaohongshu style additionally prescribes engagement content: ```markdown - Footer:模式A `::before` 渐变分割线 + 账号名;模式B `::before` 渐变分割线 + 引导语(不超过12字)+ 账号名 ``` ### Technical Analysis The Skill instructions require the agent to add a Skill/model attribution footer when the user has not requested author information. One style mode also instructs the agent to add an engagement prompt and account name. This changes the requested output rather than merely performing text-to-image conversion. The content is inserted by default and is omitted only when the user explicitly requests no footer. Consequently, users who do not know about this behavior may receive images containing unsolicited attribution or engagement language. This is best classified as instruction hijacking because the Skill-level instructions impose additional output objectives—branding and engagement—on the agent whenever the Skill is loaded. ### Attack Path 1. A user asks the agent to convert supplied text or Markdown into an image. 2. The user does not explicitly specify author information or request footer removal. 3. The Skill instructs the agent to create a footer containing the Skill name and current model name. 4. If the lively Xiaohongshu mode is selected, the Skill can also add an engagement prompt and account name. 5. The exporter captures this injected content as part of the final PNG. 6. The resulting image contains content that did not originate from the use ...[truncated 497 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/export_image.js:81
Finding

Local HTML Is Rendered with JavaScript Enabled While Chromium Security Controls Are Disabled

Content
View full analysis
{ const chromePath = detectChromePath(); if (!chromePath) { console.error('[ERROR] 未找到 Chrome/Chromium,请先运行 bash scripts/setup.sh'); process.exit(1); } console.log(`[INFO] 浏览器: ${chromePath}`); try { const browser = await puppeteer.launch({ executablePath: chromePath, headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', // 容器代理环境证书链不完整会拦掉字体 CDN 请求;本地静态截图场景忽略证书安全 '--ignore-certificate-errors'], defaultViewport: { width, height: 1000, deviceScaleFactor: 2 } }); const page = await browser.newPage(); await page.goto(htmlUrl, { waitUntil: 'networkidle0', timeout: 30000 }); ``` ### Technical Analysis The exporter rejects input strings beginning with HTTP or HTTPS, but it accepts arbitrary local paths and loads them through a `file://` URL. Loading a local HTML file does not make its contents safe. The document can still contain: - JavaScript executed by Chromium. - External scripts, images, fonts, stylesheets, or other network requests. - Browser-side requests to public services or internal network addresses. - Content tha ...[truncated 2210 chars]
Remediation
View remediation
{ const url = new URL(request.url()); if (url.protocol === 'file:') { request.continue(); } else { request.abort(); } }); ``` 5. If remote fonts are required, use a narrow allowlist for exact HTTPS font hosts and resource types, or bundle fonts locally. 6. Validate that the input: - Has an `.html` extension. - Resolves inside a dedicated trusted temporary directory. - Is a regular file rather than a symbolic link or special file. 7. Generate a restrictive Content Security Policy that blocks scripts, frames, plugins, navigation, and unexpected connections. 8. Escape user-provided text before inserting it into HTML. Do not directly concatenate untrusted Markdown or text into executable markup. 9. Use a dedicated low-privilege account and an isolated container with outbound networking disabled for rendering. 10. Add security tests using HTML containing scripts, external resources, redirects, and internal-network URLs to verify that all such behavior is blocked. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/setup.sh:78
Finding

Runtime Installation of an Unpinned Dependency Without a Lockfile

Content
View full analysis
/dev/null || echo "?") ok "puppeteer-core@$PKG_VER 已安装" else warn "puppeteer-core 未安装,正在安装..." info "运行:npm install --omit=dev --omit=optional(在 $SKILL_DIR,安装过程输出可见)" cd "$SKILL_DIR" && npm install --omit=dev --omit=optional PKG_VER=$(node -e "console.log(require('$SKILL_DIR/node_modules/puppeteer-core/package.json').version)" 2>/dev/null || echo "?") ok "puppeteer-core@$PKG_VER 安装完成" fi ``` `package.json`: ```json { "dependencies": { "puppeteer-core": "^22.0.0" } } ``` ### Technical Analysis The project does not include a lockfile in the audited directory structure. Its only dependency is specified using the range `^22.0.0`, which permits later compatible releases rather than selecting one exact reviewed artifact. When `node_modules/puppeteer-core` is absent, `setup.sh` automatically invokes `npm install`. Resolution therefore depends on the registry and package metadata available at installation time. The installed dependency tree may change between executions even though the Skill source has not changed. The command also does not use `--ignore-scripts`. NPM lifecycle scripts from resolved packages can consequently execute during installation when present. Although no evidence was found that the legitimate `puppeteer-core` package is malicious, this installation design creates avoidable supply-chain exposure. ### Attack Path 1. The Skill is invoked on a system where `node_modules/puppeteer ...[truncated 1371 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (38)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向用户的文本转图片/海报生成技能,核心能力应包括内容排版、视觉风格处理以及导出图片。实际代码仅执行静态检查:读取 HTML 文件、用正则匹配 emoji、输出检查结果并设置退出码。这更像是生成截图流程中的一个辅助校验脚本,而不是所声明技能的主要功能。由于提供的代码片段的主要行为与声明的主要用途明显不同,应判定为不匹配。

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

md
node scripts/export_image.js <html> <output.png> 600 --fixed-height 800

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/export_image.js <html> <output.png> 600 --fixed-height 800

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/export_image.js <html> <output.png> 600 --fixed-height 800

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/export_image.js <html> <output.png> 600 --fixed-height 800

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [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 · SKILL.md (reported line 219)May include surrounding context.

md
�:

1. 命令中显式传入的输出路径
2. 环境变量 `T2EI_OUTPUT_DIR`
3. 默认值:`./output`(当前工作目录下的 `output/`)

> 💡 **首次使用引导**:第一次为用户生成长图前,询问一次"希望把图片输出到哪个目录?"
> - 用户不指定 → 用默认 `./output`
> - 用户指定固定目录 → 建议写入环境变量持久化:
>   ```bash
>   echo 'export T2EI_OUTPUT_DIR="$HOME/my-images"' >> ~/.bashrc
>   ```
> 之后不再重复询问。

**Footer 参数说明:**

| 参数 | 效果 |
|------|------|
| 不传(默认) | 使用 HTML 中已写好的 footer(见 Step 2) |
| `--author "自定义文字"` | 替换 footer 为指定文字 |
| `--no-footer` | 完全移除 footer |

脚本自动检测 Chrome/Chromium 路径(Linux/macOS/WSL),自动等待 webfont 加载(最多 8s,CDN 不可达不阻塞),自动测量内容高度精确裁剪,输出目录不存在会自动创建。宽度默认 600px,2x deviceScaleFactor

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · CHANGELOG.md (reported line 13)May include surrounding context.

md
### Security

- **Removed remote-URL rendering branch** in `export_image.js`: the renderer previously accepted any `http(s)://` input and navigated a headless browser to it, effectively turning a local text/Markdown-to-image tool into a general-purpose web fetcher (SSRF / internal-network probing surface). It now only accepts local HTML file paths; remote URLs are rejected with a clear error. Normal usage (write content to a local `.html`, then render) is unchanged.
- **Dependency install is no longer silent**: `setup.sh` dropped `--silent` on `npm install`, so the puppeteer-core installation is now visible. SKILL.md wording updated from "silently auto-installs, no confirmation" to "prompts and installs with visible output", removing the undocumented-side-effect concern. Behavior is otherwise identical.

## [1.2.0] - 2026-07-27

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says the skill triggers on phrases like “做海报”, “做大图”, and “make a poster”, which are generic requests that could arise in many contexts outside this specific skill. The trigger guidance does not provide exclusion conditions or tighter scope, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The phrase “等意图时触发本技能” indicates the skill may activate on similar intents beyond the listed examples, but it does not define boundaries for what counts as in-scope. This creates ambiguity about when the skill should activate versus when it should not.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s natural-language content, triggers, and expected agent responses are entirely specified in Chinese, with no indication that users may choose another language or locale. This can violate language/locale policy when the skill behavior is implicitly constrained to a single language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation explicitly recommends launching Puppeteer/Chrome with --ignore-certificate-errors to work around TLS problems when loading remote fonts. Disabling certificate validation undermines HTTPS protections and can allow man-in-the-middle interception or content substitution, which is especially risky because the renderer fetches external resources during automated browser execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docs recommend bypassing TLS certificate validation without an explicit warning that this weakens transport security for all HTTPS requests made by the headless browser session. In a text-to-image skill, this is not a justified core capability; it expands exposure to malicious font/CDN responses and broader network tampering during rendering.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file’s instructional and descriptive text is entirely in Chinese, including usage guidance and copying instructions, without offering any language choice or indicating that the style is intentionally region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s instructional content is written in Chinese and presents usage guidance in that language without any indication that users may choose another language or that the style is intentionally limited to a Chinese-speaking context. The policy requires flagging language or locale constraints when they are imposed without user opt-in or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all instructions and warnings in Chinese, including required setup steps, but does not indicate that the skill is Chinese-only or provide any language opt-in. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill description and usage guidance are written in Chinese, and the CSS font stack explicitly prioritizes Chinese locale fonts such as "PingFang SC". There is no indication that users may choose another language or that the locale restriction is intentional and documented as a region-specific 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 markdown content is written entirely in Chinese and presents the style definition and usage guidance only in Chinese, with no indication that users may choose another language or locale. This can violate language/locale policy when a skill implicitly constrains interaction or outputs to a specific language without explicit opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document presents the style description entirely in Chinese and constrains the showcased typography to Chinese fonts and Chinese cultural use cases without offering any language or locale choice. The policy explicitly flags language or locale constraints when they are forced rather than optional or clearly documented as region-specific compliance behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown content, headings, descriptions, and instructions are all presented in Chinese, and the file does not indicate that the user can choose another language or that the skill is intentionally limited to a Chinese-language audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The template hard-codes <html lang="zh-CN">, which instructs generated output to use a specific language/locale. This is a natural-language policy concern because the file does not offer opt-in, alternatives, or a documented justification that the skill is intended only for Chinese-language use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The markdown instructs the agent to save HTML to /tmp and later export a PNG to a user-configurable directory, but it frames this operationally rather than as a user-facing warning about local file creation. Because the skill affects the filesystem, the description should more explicitly disclose this behavior to users.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a skill for converting Markdown/plain text into styled images, but these lines direct the user to edit ~/.bashrc to persist an environment variable. Persistently changing shell configuration is outside the obvious scope of image generation and introduces a system-configuration capability unrelated to the core formatting task.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The dependency is version-ranged with a caret (^22.0.0), which allows automatic installation of newer minor and patch releases rather than a fully fixed version. This increases supply-chain risk and can lead to non-reproducible builds or unintended uptake of a compromised or breaking upstream release, though by itself it is not evidence of active malicious behavior.

Content

Scanner excerpt · package.json (reported line 7)May include surrounding context.

json
"description": "Puppeteer script runner for MD to Long Image skill",
  "main": "scripts/export_image.js",
  "dependencies": {
    "puppeteer-core": "^22.0.0"
  }
}

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains natural-language guidance in Chinese for applicability and usage, but does not indicate that the language is optional or limited to a justified region-specific context. Under the language/locale policy criterion, forcing or assuming a specific language without user opt-in can be a policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file uses natural-language guidance specifically for Chinese writing contexts, such as preventing awkward Chinese line breaks, and the CSS font stack is tailored to Simplified Chinese serif fonts. Because the file does not state that the style is intended only for Chinese content or offer a locale/language choice, it can be read as imposing a language/locale assumption.

Content

No source excerpt is available for this finding.