Back to skill

Security audit

Copywriting Generator

Security checks for vulnerabilities and agentic risk

Overview

This is a simple Chinese marketing-copy generator with no hidden install steps, network access, persistence, or credential handling, though it has minor quality and robustness issues.

Install only if you want a Chinese-language marketing-copy helper. Avoid passing very large generation counts, and treat the A/B testing and paid-tier/data-tracking descriptions as marketing claims rather than implemented functionality in this artifact.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
tools/generate_copy.js:76
Finding
Unbounded User-Controlled Generation Count Can Cause Resource Exhaustion<![CDATA[ ## Vulnerability Details **File Location**: `tools/generate_copy.js:76`, `tools/generate_copy.js:160`, `tools/generate_copy.js:224`, and `tools/generate_copy.js:244` **Vulnerability Type**: Uncontrolled resource consumption / local denial of service **Risk Level**: Medium ### Vulnerable Code ```javascript function generateTitles(product, count = 10, style = 'xiaohongshu') { const titles = []; const platform = PLATFORM_STYLES[style] || PLATFORM_STYLES.xiaohongshu; for (let i = 0; i < count; i++) { let template = TITLE_TEMPLATES[i % TITLE_TEMPLATES.length]; // Title generation omitted titles.push(title); } return titles; } ``` ```javascript function generateCTAs(count = 5) { const ctas = []; for (let i = 0; i < count; i++) { let template = CTA_TEMPLATES[i % CTA_TEMPLATES.length]; // CTA generation omitted ctas.push(cta); } return ctas; } ``` The counts are read directly from command-line arguments without range or finiteness validation: ```javascript case 'titles': { const product = args[1] || '产品'; const count = parseInt(args[2]) || 10; const style = args[3] || 'xiaohongshu'; const titles = generateTitles(product, count, style); console.log('📝 标题方案:\n'); titles.forEach((t, i) => console.log(`${i + 1}. ${t}`)); break; } ``` ```javascript case 'ctas': { const count = parseInt(args[1]) || 5; const ctas = generateCTAs(count); console.log('🎯 CTA 方案:\n'); ctas.forEach((c, i) => console.log(`${i + 1}. ${c}`)); break; } ``` ### Technical Analysis The `titles` and `ctas` commands accept a user-controlled count and pass it to loops that allocate one array element per iteration. There is no maximum permitted count, no `Number.isFinite` check, and no validation that the value is a safe positive integer. A sufficiently large finite value causes excessive CPU consumption and heap growth while the output array is constructed. If construction succeeds, printing every ...[truncated 1826 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create a shared count-validation function and apply a conservative upper bound appropriate to each command: ```javascript function parseCount(value, defaultValue, maximum) { if (value === undefined) { return defaultValue; } const count = Number(value); if (!Number.isSafeInteger(count) || count < 1 || count > maximum) { throw new Error(`Count must be an integer between 1 and ${maximum}`); } return count; } ``` Use it for both affected commands: ```javascript const count = parseCount(args[2], 10, 100); // titles const count = parseCount(args[1], 5, 100); // CTAs ``` Additional hardening measures should include: 1. Catch validation errors and exit with a clear message and a nonzero status. 2. Apply limits inside `generateTitles` and `generateCTAs` as well as at the CLI boundary, so future programmatic callers cannot bypass validation. 3. Consider streaming generated entries directly rather than retaining the entire result in an array when large output is legitimately needed. 4. Run the utility with process memory, CPU, execution-time, and output-size limits when invoked by a service or agent. 5. Add tests for zero, negative values, non-numeric input, values above the maximum, `Infinity`, and integers outside JavaScript's safe range. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding
整体上,代码的大部分行为与声明相符:它确实生成营销标题、正文框架、CTA,并提供优化建议,且平台风格面向典型营销/电商场景。主要不一致在于声明明确提到“A/B 测试建议”,但代码中没有任何与 A/B 测试变体设计、实验方案、指标建议或版本对比相关的实现;suggest 命令只输出通用文案优化建议,不能等同于 A/B 测试建议。因此存在描述与实际行为不完全一致的情况,属于能力被宣称但未实现的失配。

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
All user-facing descriptions, examples, and output are written exclusively in Chinese, and the skill does not state that users may choose another language. This creates a natural-language policy concern because it implicitly constrains the interaction language without offering user opt-in or a documented locale-specific justification.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The usage section shows activation phrasing such as “帮我想…”, “帮我写…”, “帮我设计…”, and “帮我优化…”, which are common everyday requests rather than narrowly scoped trigger phrases. The file does not provide explicit trigger boundaries, exclusions, or negative examples to distinguish when this skill should activate versus ordinary conversation.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file’s user-facing natural language strings, help text, and platform descriptions are entirely in Chinese, including the CLI usage output and generated copy templates. The skill does not offer any language or locale selection, which can violate a language/locale policy when a skill forces a specific language without user opt-in.

Context-Inappropriate Capability

Low
Confidence
91% confidence
Finding
The manifest describes a text-generation utility for marketing copy, titles, CTA ideas, and A/B-style suggestions. In this file, `fs` and `path` are imported, which are capabilities unrelated to the stated purpose and unused in the implementation, indicating unjustified access-oriented capability in a content-generation tool.

Static analysis

No suspicious patterns detected.