T09 · Insecure Skill Coding Practices
- Location
SKILL.md:17- Finding
Shell Command Injection Through Raw Prompt Interpolation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it claims, but its command templates and credential handling create review-worthy risks before installation.
Install only if you are comfortable sending prompts and uploaded images to api.apiyi.com and paying for those API calls. Prefer APIYI_API_KEY over --api-key, avoid prompts or filenames containing shell metacharacters, and use an agent/runtime that passes arguments as an array rather than rendering the documented shell templates directly.
SKILL.md:17Shell Command Injection Through Raw Prompt Interpolation
scripts/generate_image.py:85API Credential Exposure Through Command-Line Arguments
scripts/generate_image.py:49Unpinned Third-Party Dependency Installation Guidance
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
print('image generation in progress...')
try:
response = requests.post(url, headers=headers, files=files_list, timeout=DEFAULT_TIMEOUT)
response.raise_for_status()
data = response.json()
except requests.exceptions.Timeout:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
print('image generation in progress...')
try:
response = requests.post(url, headers=headers, json=payload, timeout=DEFAULT_TIMEOUT)
response.raise_for_status()
data = response.json()
except requests.exceptions.Timeout:
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
Referenced artifact was not completely inspected
- **优先尝试 Node.js 版本**:如果环境有 Node(`node` 命令可用),优先使用 `scripts/generate_image.js`(零依赖,参数与 Python 保持一致)。
The skill documents capabilities that read environment variables, write files, and send data over the network, but it does not declare any tool scope or permission boundaries. That increases the risk of over-broad execution, accidental data access, and makes review/enforcement harder because consumers cannot tell up front what powers the skill requires.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
---
name: apiyi-gpt-image-2-gen
description: 图片生成技能,当用户需要生成图片、视觉信息图、创建图像、编辑/修改/调整已有图片时使用此技能。基于API易平台(https://api.apiyi.com/)的ChatGPT Image 2模型(gpt-image-2)的官方正式版图片生成服务。该模型支持精确的尺寸/画质控制(含4K),按token计费。与gpt-image-2-all(官逆版)不同的关键点:使用/v1/images/generations和/v1/images/edits端点;有显式size参数;有quality参数;按token计费;使用multipart/form-data上传参考图;b64_json为纯base64无前缀。
---
# 图片生成与编辑(GPT Image 2 官方正式版)
The skill is triggered by broad natural-language conditions such as requests to generate or edit images, which can overlap with ordinary conversation. In agent environments this can cause unintended invocation, leading to unexpected network calls, file writes, billing, or external transmission of user content.
The skill explains that prompts and reference images are sent to a remote API, but it does not clearly warn users about data egress or privacy implications. Because image-editing inputs may contain personal, confidential, or copyrighted material, silent transmission to a third party can create privacy and compliance risks.
The skill instructs the agent to pass the user's full original input directly into command arguments and preserve all text verbatim. This increases the chance that sensitive personal data, secrets, or unrelated user content will be forwarded to external services and may also end up in local shell history, logs, or telemetry.
The documentation recommends passing the API key on the command line without warning that command-line arguments may be exposed through shell history, process listings, logs, or monitoring tools. This can leak long-lived credentials to other local users or operational systems.
This code transmits prompts and uploaded image content to an external domain, which is expected for an image-generation skill but still expands the trust boundary to a third-party proxy service. The risk is elevated by the nature of the data handled—free-form text and user-supplied images may contain personal, proprietary, or regulated information.
});
}
const url = 'https://api.apiyi.com/v1/images/edits';
process.stdout.write('🎨 图片生成已启动!\n');
process.stdout.write(`⏱️ 预计时间: 约120-150秒,请耐心等待\n`);
The script sends user prompts and, in edit mode, local image files to a third-party service at api.apiyi.com, but it does not provide an explicit privacy notice or consent step at the time of transmission. In a skill context, users may supply sensitive images or confidential prompt content, so silent external transfer creates a meaningful confidentiality and compliance risk even though the transmission is part of the core feature.
The generation path also sends user prompts to the third-party API endpoint, creating the same external transmission risk even when no input image is provided. While this is core functionality rather than overtly malicious behavior, lack of explicit disclosure and reliance on a proxy service can expose sensitive prompt content and create privacy/compliance issues.
if (args.outputFormat != null) payload.output_format = args.outputFormat;
if (args.outputCompression != null) payload.output_compression = parseInt(args.outputCompression);
const url = 'https://api.apiyi.com/v1/images/generations';
process.stdout.write('🎨 图片生成已启动!\n');
process.stdout.write(`⏱️ 预计时间: 约120-150秒,请耐心等待\n`);
Natural-language policy issues apply to all file types, including code docstrings and help text. Here, the main documentation, examples, and argument descriptions are presented exclusively in Chinese, with no indication that the tool is region-specific or that other language options are available.
In edit/multi-image mode, the script uploads local image files to a third-party endpoint. Because images may contain sensitive visual content or embedded metadata, this external transmission is more dangerous in skill context than ordinary API usage; it can leak private or proprietary data outside the host environment.
mode_str = '编辑图片' if len(args.input_image) == 1 else '多图融合'
url = 'https://api.apiyi.com/v1/images/edits'
files_list = [
('model', (None, 'gpt-image-2')),
The hardcoded third-party generation endpoint indicates dependence on an external service for prompt processing and image return. While not malicious, this creates a real outbound data-transfer surface that can expose user content and operational metadata to an external processor.
print(f'错误: 请求失败 - {e}', file=sys.stderr)
sys.exit(1)
else:
url = 'https://api.apiyi.com/v1/images/generations'
payload = {
'model': 'gpt-image-2',
The script transmits user prompts to an external third-party service over the network. In the context of an agent skill, users may unknowingly send sensitive business data or personal information off-platform, creating privacy, compliance, and data-governance risk even though the transmission is intentional.
print('image generation in progress...')
try:
response = requests.post(url, headers=headers, json=payload, timeout=DEFAULT_TIMEOUT)
response.raise_for_status()
data = response.json()
except requests.exceptions.Timeout:
The documentation says an API key can be supplied via a command-line flag, but the documented interface does not define that option consistently. This mismatch can cause users to fall back to unsafe trial-and-error handling of credentials or misunderstand how secrets are passed to the script.
Natural-language instructions, parameter descriptions, and usage examples are presented only in Chinese. Under the stated policy, forcing a specific language without opt-in or a documented region-specific justification is a locale/language policy violation.
No suspicious patterns detected.