Back to skill

Security audit

自媒体文案生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible Chinese social-media copy generator, but it embeds a third-party API key and can send user prompts to DashScope through an under-documented code path.

Review before installing. The current CLI appears to use mock/local generation by default, but the package includes a hardcoded DashScope API key and a code path that can transmit your prompt details to Alibaba DashScope if remote generation is activated. The publisher should remove and rotate the key, require explicit remote-provider configuration, disclose what data is sent, and constrain output-file writes before this is treated as low-risk.

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

Error
Location
src/generator.py:251
Finding

Hardcoded DashScope API Credential and Misleading Client Activation

Content
View full analysis

Vulnerability Details

File Location: src/generator.py:251-296
Vulnerability Type: Hardcoded secret and unintended remote API activation
Risk Level: High

The generator contains a plaintext DashScope API key. Although the command-line entry point creates the generator without a client and therefore uses local mock generation, library callers can activate the remote request by passing any truthy value as client. The supplied client object is not actually used to perform the request.

Vulnerable Code

Remote generation is activated based only on the truthiness of self.client:

python
if self.client:
    response = self._call_llm(
        system=template["system"],
        user=user_prompt
    )
else:
    response = self._mock_generate(request)

The activated method uses a credential embedded directly in the source:

python
api_key = "sk-sp-1f1d92cdff7d4cbd8dcbe1cd08711606"
url = "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"

data = {
    "model": "qwen3.5-plus",
    "messages": [
        {"role": "system", "content": system},
        {"role": "user", "content": user}
    ],
    "temperature": 0.7,
    "max_tokens": 2000
}

req = urllib.request.Request(
    url,
    data=json.dumps(data).encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {api_key}'
    }
)

with urllib.request.urlopen(req, timeout=30) as response:
    result = json.loads(response.read().decode('utf-8'))
    content = result['choices'][0]['message']['content']
    return content.strip()

Technical Analysis

Secrets embedded in source code become available to every person or system that can read the project, including users who download the Skill, source-control users, build systems, backups, and artifact scanners. The key cannot be considered confidential after distribu ...[truncated 2974 chars]

Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the exposed credential immediately.

    • Treat the displayed key as compromised even if there is no confirmed abuse.
    • Review provider logs, billing records, quota usage, source-control history, build artifacts, and published packages for unauthorized use.
  2. Remove the credential from all source and artifact history.

    • Delete the literal from the current source.
    • Purge it from repository history and previously published artifacts where practical.
    • Do not assume deleting it from the latest revision restores confidentiality.
  3. Use secure external configuration.

    • Read the credential from an environment variable such as DASHSCOPE_API_KEY or from a dedicated secret manager.
    • Never log, print, serialize, or include the credential in exceptions.
    • Apply provider-side restrictions, minimal permissions, quotas, and expiration where supported.
  4. Correct the client interface.

    • If callers supply a client, invoke that client's documented generation method directly.
    • Alternatively, remove the generic client argument and replace it with an explicit provider configuration or an enable_remote_generation option.
    • Do not use an arbitrary object merely as a Boolean switch for a different hardcoded client.
  5. Make remote transmission explicit and fail safely.

    • Keep generation offline by default.
    • Require explicit configuration and user consent before transmitting prompts.
    • If remote generation is requested without a credential, return a clear configuration error rather than silently selecting a shared secret.
    • Document exactly which fields are transmitted and to which service.
  6. Align documentation with implementation.

    • Update README.md and SKILL.md to disclose the conditional network request.
    • Remove statements implying that real LLM integration is still pending if the feature r ...[truncated 338 chars]
Vulnerability Patterns
  • 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (34)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill actually performs undeclared external network access, uses hardcoded API credentials, and writes files locally, that is a real security issue because users and hosts cannot make informed trust decisions. Hardcoded secrets can be extracted and abused, while hidden network/file behaviors expand the attack surface beyond the stated content-generation purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the skill actually performs undeclared external network access, uses hardcoded API credentials, and writes files locally, that is a real security issue because users and hosts cannot make informed trust decisions. Hardcoded secrets can be extracted and abused, while hidden network/file behaviors expand the attack surface beyond the stated content-generation purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

A hardcoded API key is embedded directly in source code, which exposes a live credential to anyone with access to the repository, package, logs, or distributed artifact. Attackers can reuse the key to consume the owner's quota, incur billing charges, or access associated third-party services until the credential is revoked.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · 技术架构.md (reported line 261)May include surrounding context.

md
GET  /api/v1/templates?platform=xiaohongshu&category=beauty
POST /api/v1/templates
PUT  /api/v1/templates/:id
DELETE /api/v1/templates/:id

# 历史记录
GET /api/v1/history?page=1&limit=20

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · 技术架构.md (reported line 266)May include surrounding context.

md
# 历史记录
GET /api/v1/history?page=1&limit=20
GET /api/v1/history/:id
DELETE /api/v1/history/:id

# 收藏管理
POST /api/v1/favorites/:recordId

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · 技术架构.md (reported line 270)May include surrounding context.

收藏管理

POST /api/v1/favorites/:recordId DELETE /api/v1/favorites/:recordId GET /api/v1/favorites

text

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The privacy section claims the system does not store sensitive personal information, but the schema includes user email addresses. This creates a misleading privacy assurance that can cause under-protection of personal data and noncompliance with privacy obligations, especially if users or operators rely on the inaccurate claim.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

该文档从标题、功能说明到使用示例全部使用中文,没有说明这是仅面向特定中文区域用户的工具,也没有提供其他语言选项或用户选择机制。按规则,强制单一语言且缺少用户 opt-in 或明确地域性 justification,属于自然语言层面的 locale policy 风险。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The release notes state that the skill integrates with the 百炼 dashscope API, but they do not disclose that user prompts and possibly generated content may be sent to a third-party provider. In a content-generation skill, users may input sensitive business plans, drafts, personal data, or unpublished material, so omission of this data-transfer warning creates a meaningful privacy and compliance risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

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 forces a single language/locale experience through its name, description, headings, parameters, and examples, but does not provide any user opt-in or alternative language support. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file uses Chinese throughout, including the title, body, and metadata, with no indication that the skill is region-specific or that users can opt into this language. Under the policy rule, forcing a specific language without user choice 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
91% confidence
Finding

The file content is entirely written in Chinese and targets a specific platform style without any indication that language choice is optional. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file is entirely written in Chinese and specifically targets the Xiaohongshu platform audience with phrases like “姐妹们!”, without indicating that language choice is optional or user-selected. This can violate language/locale policy when a skill imposes one language by default instead of offering a choice or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script accepts a user-supplied output path and writes generated content to that path, creating or overwriting local files and parent directories. For a copywriting generator, file output may be convenient, but unrestricted path selection can modify arbitrary user-accessible files if the tool is invoked in automation or with elevated privileges.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Arbitrary local file creation/modification is not inherently required to generate copy, and the implementation writes whatever content is produced to any provided path. In a broader agent environment, this increases the blast radius of prompt-influenced output by enabling persistence on disk in unintended locations.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · generate.py (reported line 131)May include surrounding context.

python
---
**平台**: {result.platform.value}
**字数**: {result.word_count}
**生成时间**: {__import__('datetime').datetime.now().strftime('%Y-%m-%d %H:%M:%S')}

## 标签
{tag_recommender.format_tags(recs, args.platform) if not args.no_tags else '无'}

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module description and user-facing generation prompts are written in Chinese and assume Chinese-language operation. This can violate language/locale policy when a specific language is enforced without user choice or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code sends user topic, keywords, tone, length, and target audience data to an external LLM API without explicit warning or informed consent. Even if the data seems business-related, users may enter confidential campaign plans, client information, or sensitive personal details, making undisclosed exfiltration to a third party a meaningful privacy risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The generator transmits user-provided content to a third-party LLM service, while the skill description frames the tool as a local one-click copywriting generator and does not clearly disclose remote processing. This creates a privacy and transparency risk because topics, keywords, and audience data may be sensitive and are sent off-device to an external provider.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This Python file contains user-facing natural-language descriptions entirely in Chinese, beginning with the module docstring describing the skill as a Chinese tag recommender. The skill does not indicate that language is configurable or that Chinese-only behavior is required for a documented region-specific purpose, which can violate language/locale choice policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The design includes platform API integration, historical preference autofill, effect tracking, and record/history management, but it does not mention user notice, consent, data minimization, retention, or access controls. In a content-generation product, these features can expose behavioral data, account-linked content, and potentially sensitive commercial or personal information if collected or reused without transparent privacy safeguards.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly proposes user preference learning and learning from historical high-quality copy, which implies retention, profiling, and secondary use of user-generated content or behavioral data. Without requirements for notice, consent, retention limits, deletion controls, or purpose limitation, the feature can create privacy risk, regulatory exposure, and misuse of personal or commercially sensitive writing patterns.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a one-click multi-platform copywriting generator, but the architecture specifies persistent storage of user information and preferences in PostgreSQL. While storing generation history can support the feature, maintaining general user data and preference profiles goes beyond the narrowly stated content-generation purpose and introduces additional capability not justified by the manifest text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The design includes persistent history, file storage, export, and analytics capabilities that affect user data, but the document does not describe explicit user-facing notice or consent around those behaviors. This increases the risk of silent retention or secondary use of generated content and metadata, which is especially relevant for a content-generation skill handling user prompts and drafts.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.