Back to skill

Security audit

网瘾中年公众号封面设计

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a prompt-writing helper, but it also includes an optional image-generation script that uses local API credentials and uploads prompts or reference images, which is not consistently disclosed in the prompt-only framing.

Review this skill before installing if you do not want an agent to have an in-scope path to use local ARK credentials. Use the prompt-only workflow unless you intentionally configure ARK, keep ~/.baoyu-skills/.env private, avoid custom ARK_BASE_URL values, and only pass reference images you are comfortable uploading to the image provider.

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
gen_cover_volc.py:63
Finding

Bearer Credential and Reference Images Can Be Sent to an Unrestricted Configurable Endpoint

Content
View full analysis
1 else refs[0] print(f"-> 参考图数量: {len(refs)}") data = json.dumps(body).encode("utf-8") req = urllib.request.Request(url, data=data, method="POST") req.add_header("Content-Type", "application/json") req.add_header("Authorization", "Bearer " + api_key) print(f"-> POST {url}") print(f"-> model={args.model} size={args.size} watermark=False") try: with urllib.request.urlopen(req, timeout=180) as resp: ``` ### Technical Analysis The script reads `ARK_BASE_URL` from `~/.baoyu-skills/.env` and uses it without validating its scheme or destination host. It then attaches the ARK bearer credential to the request and submits the user's prompt and any selected reference images. Reference images are base64-encoded as required by the image-generation API. That encoding is legitimate functionality rather than an independent covert channel. However, because the destination is unrestricted, these encoded files can be delivered to an unintended or attacker-controlled service. The implementation does not require HTTPS, does not restrict the endpoint to the documented Volcengine ARK host, and does not distinguish between a trusted pro ...[truncated 2055 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose says the skill only generates prompts, but the body adds direct image generation, reads local credential files, uploads local reference images, and writes output files. This mismatch is dangerous because users and hosting systems may grant trust under a low-risk prompt-generation description while the skill actually performs privileged file and network actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill metadata says it generates cover prompts, but this file performs direct remote image generation and writes output files locally. That capability mismatch is dangerous because users may grant or run the skill expecting only text processing, while it actually accesses external services, consumes API-backed resources, and handles files and images.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The code and docstring indicate access to credentials stored in ~/.baoyu-skills/.env, which is a sensitive local secret source. In the context of a skill advertised as prompt generation, credential access is more dangerous because it is not necessary for the stated function and broadens what the skill can do without obvious user awareness.

Content

Scanner excerpt · gen_cover_volc.py (reported line 5)May include surrounding context.

python
# -*- coding: utf-8 -*-
"""
调用火山引擎 ARK (Seedream) 生成公众号封面。
读取 ~/.baoyu-skills/.env 中的 ARK_API_KEY / ARK_BASE_URL。
支持:
  - 文生图(默认)
  - 多参考图(--ref 可重复,base64 传入 image 字段)

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The hardcoded path to ~/.baoyu-skills/.env causes the script to access a local secret store automatically. This is dangerous because it enables remote-service use with locally stored credentials in a skill whose published description does not justify secret access, increasing the risk of unintended secret use and surprise data transfer.

Content

Scanner excerpt · gen_cover_volc.py (reported line 20)May include surrounding context.

python
import urllib.request
import urllib.error

ENV_PATH = os.path.expanduser("~/.baoyu-skills/.env")
DEFAULT_OUTPUT_DIR = os.path.dirname(os.path.abspath(__file__))
DEFAULT_MODEL = "doubao-seedream-5-0-260128"
DEFAULT_SIZE = "2976x1264"  # ≈2.35:1, 总像素 3,760,064 >= 3,686,400, 均为16倍数

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · results.tsv (reported line 1)May include surrounding context.

text
timestamp	commit	skill	old_score	new_score	status	dimension	note	eval_mode
2026-07-26T15:55	baseline	wangyin-zhongnian-cover-design	-	73.4	baseline	-	初始评估,dim3/dim4/dim9 偏低	dry_run
2026-07-26T15:58	opt1	wangyin-zhongnian-cover-design	73.4	84.0	keep	dim4+dim3+dim9	加🔴CHECKPOINT两处+if-then失败表+反例黑名单章节	full_test
2026-07-26T16:02	opt2	wangyin-zhongnian-cover-design	84.0	94.0	keep	runtime+P0	README安装改runtime中立三层结构,清Claude Code硬编码路径	full_test

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documents capabilities to read local files and perform network-backed image generation, but it declares no explicit tool scope or permission boundaries. That creates an authorization ambiguity where an agent runtime may permit broader access than users expect, especially because the skill also references local config, credential files, and external API calls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction says the skill "只产出中文提示词" and does not provide any opt-in or alternative language choice. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale constraint is clearly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The optional Volcengine ARK section materially expands the skill from passive prompt authoring to active external API usage that can transmit user content and produce files. Even if labeled optional, embedding this behavior in the skill increases the chance an agent will treat it as in-scope and execute higher-risk actions without users realizing the skill is no longer prompt-only.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to read API keys from a local dotfile and send prompts plus reference images to an external service, which is beyond what is necessary for a prompt-generation skill. This creates clear risk of secret handling, unintended local data access, and exfiltration of user-supplied or locally stored images to a third party.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script reads API credentials from ~/.baoyu-skills/.env even though the advertised skill is only prompt generation. Accessing local secrets beyond the stated purpose expands the trust boundary and can surprise users, especially when those credentials are then used to send prompts and images to a remote service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script transmits stdin prompt content and optional reference images to a remote API without an explicit warning or consent checkpoint. Prompts and images may contain sensitive business, personal, or proprietary information, so silent transmission increases privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Tainted flow: 'req' from sys.stdin.read (line 88, user input) → urllib.request.urlopen (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · gen_cover_volc.py (reported line 95)May include surrounding context.

python
print(f"-> POST {url}")
    print(f"-> model={args.model} size={args.size} watermark=False")
    try:
        with urllib.request.urlopen(req, timeout=180) as resp:
            payload = json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        detail = e.read().decode("utf-8", errors="replace")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill file is written as a prescriptive style specification in Chinese, including the prompt template at L27, with no indication that language choice is optional or user-selectable. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy violation unless the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill file is written as a Chinese-only style specification, including the required template line and typography choices, with no indication that users may opt for another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire skill file is written as prescriptive content in Chinese and provides no indication that language is optional or limited to a justified region-specific use case. Per 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
91% confidence
Finding

The file is entirely framed in Chinese, including the title, scenario description, and prompt template line, which indicates a fixed language/locale expectation. There is no user opt-in, alternative language option, or documented regional justification, so this appears to violate the language/locale policy constraint.

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 is entirely written as a prescriptive style specification in Chinese, including the required first prompt line at L25, and does not indicate that other languages are allowed or that Chinese is optional. Under the stated policy, forcing a specific language or locale 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
93% confidence
Finding

The entire skill file is written as a prescriptive style template in Chinese, including the required prompt line and typography guidance, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The document mandates Chinese-specific font choices such as '思源黑体 Heavy / Source Han Sans CN Heavy' and 'PingFang SC / Microsoft YaHei' as required constraints for generated prompts. Because the file states all generated cover prompts must follow these constraints, it imposes a specific language/locale convention without any user opt-in or alternative locale path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This file is a plain-text LICENSE file, so only SQP-3 applies here. Lines L25-L26 add explanatory licensing notes in Chinese only, which imposes a specific language on readers without any opt-in or indication that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script silently reads API credentials from a local .env file without prominently informing the user. While this is a common developer pattern, it is a security-relevant capability that should be disclosed because it accesses local secrets outside the apparent scope of simple prompt generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The instruction mandates '思源黑体 Heavy' and the surrounding content is entirely in Chinese, with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language or locale without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s natural-language instructions are entirely in Chinese and do not indicate that other languages are supported or that the user can choose a preferred language. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The natural-language content in the note column is written in Chinese across multiple rows, which can imply a fixed language choice for users or maintainers reading this skill artifact. The file does not indicate that Chinese is optional, user-selected, or required for a documented region-specific purpose.

Content

No source excerpt is available for this finding.