T09 · Insecure Skill Coding Practices
- Location
content_producer.py:164- Finding
API Credential Disclosure Through an Unrestricted Custom Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to be a legitimate Chinese social-content generator, but it forwards an OpenAI bearer token and user prompts to any configured API endpoint without strong safeguards.
Install only if you are comfortable sending your topics, points, and drafts to the configured LLM provider and storing generated markdown locally. Use the default trusted OpenAI endpoint or a third-party endpoint you independently trust, preferably with a separate scoped API key and spending limits; do not point OPENAI_BASE at an untrusted proxy while using your main OpenAI key.
content_producer.py:164API Credential Disclosure Through an Unrestricted Custom Endpoint
content_producer.py:13Unpinned and Unnecessary Third-Party Dependency Installation
The request target is derived from the unvalidated OPENAI_BASE environment variable, and the code sends the Authorization bearer token plus full user content to that endpoint. If an attacker can influence the environment, they can redirect traffic to an attacker-controlled server and capture the API key and all generated content requests, which is a real SSRF/credential-exfiltration risk.
log(f" 调用 {OPENAI_MODEL} 生成 {cfg['name']} 内容...")
try:
resp = requests.post(
f"{OPENAI_BASE}/chat/completions",
headers={
"Authorization": f"Bearer {OPENAI_API_KEY}",
The README instructs users to configure an API key and even allows swapping in third-party compatible endpoints, but it does not clearly warn that the topic, points, and generated content will be sent to an external model provider. This creates a real privacy and data-governance risk because users may submit proprietary, client, or personal content without understanding it leaves the local environment.
The README explicitly configures a remote API endpoint and promotes use of alternative proxy or third-party compatible APIs, which confirms external transmission of user prompts and content. In a content-generation skill, this is contextually expected, but it is still security-relevant because sensitive drafts, business plans, or personal information may be transmitted off-host to providers with different trust and retention properties.
| 变量 | 默认值 | 说明 |
|------|--------|------|
| `OPENAI_API_KEY` | - | **必填** OpenAI API Key |
| `OPENAI_BASE` | `https://api.openai.com/v1` | API地址(可换代理/第三方兼容API) |
| `OPENAI_MODEL` | `gpt-4o-mini` | 模型(推荐 gpt-4o-mini,便宜够用) |
| `CONTENT_OUTPUT_DIR` | `./content_output` | 输出目录 |
The skill advertises behavior that relies on environment variables, network access to an external API, and local file writes, but it does not declare any explicit tool scope or permissions. This weakens reviewability and user consent because operators cannot easily see that the skill can transmit user input externally and persist outputs to disk.
The skill states that generated content is automatically archived and can be viewed and reused later, but it does not clearly warn that user-supplied topics and derived content may be stored on disk indefinitely. If users provide sensitive business plans, drafts, or proprietary prompts, this persistence can create unintended local data exposure and retention risk.
The skill requires an OpenAI API key and says it is OpenAI-driven, which implies that user topics and points will be transmitted to an external AI service, yet the description does not clearly warn users about this data transfer. Users may unknowingly send confidential, regulated, or proprietary content to a third-party processor, creating privacy, compliance, and contractual risk.
The file describes the tool entirely in Chinese and its stated purpose is producing content for Chinese platforms, but it does not explicitly tell the user that output language is restricted or optional. The prompts and system message also hard-code Chinese content generation, which is a natural-language locale constraint without user opt-in.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# ========== 配置 ==========
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", "")
OPENAI_BASE = os.environ.get("OPENAI_BASE", "https://api.openai.com/v1")
OPENAI_MODEL = os.environ.get("OPENAI_MODEL", "gpt-4o-mini") # 便宜且够用
OUTPUT_DIR = Path(os.environ.get("CONTENT_OUTPUT_DIR", "./content_output"))
This script transmits user-supplied topics and points to an external LLM service. That is expected for the feature, but it is still a genuine data egress point and becomes more sensitive because the tool is designed for arbitrary user-provided content and may handle unpublished or proprietary material.
log(f" 调用 {OPENAI_MODEL} 生成 {cfg['name']} 内容...")
try:
resp = requests.post(
f"{OPENAI_BASE}/chat/completions",
headers={
"Authorization": f"Bearer {OPENAI_API_KEY}",
The system message says the model is an expert Chinese content creator, which enforces a specific language/locale for all generations regardless of user preference. This is a natural-language policy issue because the skill does not provide a language choice or clearly justify the restriction in-code.
A language/locale policy issue applies across all file types when a skill effectively forces a specific language without user opt-in. This README presents all instructions and examples only in Chinese, with no indication of alternative language support or explicit scope limitation.
The description presents the skill as targeting Chinese platforms and Chinese content formats only, with no indication that users can choose another language or locale. Under the stated policy, hard-coded language or locale behavior without opt-in can be a natural-language policy concern unless clearly documented as region-specific and justified.