T09 · Insecure Skill Coding Practices
- Location
scripts/app.py:17- Finding
Hard-Coded Flask Signing Key and Third-Party API Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This paid AI script generator is not plainly malicious, but it needs Review because it embeds service credentials, exposes an unsafe debug server, and has unclear billing behavior.
Install only after the publisher fixes billing consent and pricing consistency, removes and rotates embedded API keys, disables Flask debug/all-interface binding for deployment, validates payment URLs, documents third-party AI data sharing, and escapes generated content before rendering.
scripts/app.py:17Hard-Coded Flask Signing Key and Third-Party API Credentials
scripts/app.py:243Network-Exposed Flask Development Debugger
templates/index.html:123Stored DOM Cross-Site Scripting Through Unescaped Script Content
${script.hook}
${script.voiceover}
${script.subtitle}
${script.bgm}
scripts/app.py:151Unvalidated Third-Party Payment URL Used for Redirects and Links
scripts/app.py:128Advertised Pricing Does Not Match Implemented Billing Semantics
The declared purpose and pricing do not match the reported behavior: the skill allegedly performs billing, persistent storage, and user/session tracking beyond what is clearly disclosed, and it also has a price mismatch. This is dangerous because users may be charged, tracked, or have data retained without informed consent, creating risks of deceptive billing, privacy violations, and ownership/access control issues around stored content.
The before_request hook triggers billing automatically for most endpoints before the user performs an explicit pay-confirmed action on that request. This is dangerous because users can incur charges merely by accessing functionality, without a clear charge-point confirmation or informed consent flow.
The skill advertises capabilities that imply networked/payment-backed behavior, but the manifest shown does not declare any explicit tool scope such as permissions or allowed-tools. Missing scope declarations reduce transparency and can allow reviewers or users to misunderstand what external actions the skill may perform, especially in a paid workflow that may contact remote services.
This file includes user-facing natural-language content such as comments, error strings, and especially the AI prompt in Chinese, with no indication that users can choose another language or locale. Under the language/locale policy, forcing a specific language without opt-in can be a policy violation unless clearly justified as region-specific.
A live API key is hardcoded directly in source code for the external AI service. Embedded secrets are highly dangerous because anyone with code access can reuse the credential for unauthorized API calls, incur cost, access associated account resources, or pivot into related systems if key scope is broad.
# 硅基流动API配置
SILICONFLOW_API_KEY = 'sk-ggfjehtmwgthcdyajhpipxhurytmnmqsnvpfzoripdgdmzar'
SILICONFLOW_API_URL = 'https://api.siliconflow.cn/v1/chat/completions'
AI_MODEL = 'Doubao-ai/doubao-seed-v2-18k'
# 初始化数据库
User-provided topic data is sent to a third-party AI API, but this code path contains no explicit privacy notice or consent mechanism. That creates a data-sharing risk, especially if users enter sensitive, personal, or proprietary content expecting local-only processing.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
'max_tokens': 2000,
'response_format': {"type": "json_object"}
}
resp = requests.post(SILICONFLOW_API_URL, headers=headers, json=payload, timeout=30)
data = resp.json()
content = data['choices'][0]['message']['content']
return json.loads(content)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if TEST_MODE:
return {"ok": True, "balance": 1000}
try:
resp = requests.post(f"{BILLING_URL}/charge", headers=HEADERS, json={
"user_id": user_id, "skill_id": SKILL_ID, "amount": 0.001,
}, timeout=10)
data = resp.json()
The manifest says the skill costs $0.005 per use, but the implemented billing endpoints use amount 0.001. This creates a billing-integrity issue: users may be charged a different amount than disclosed, and the discrepancy undermines consent and trust around payments.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if TEST_MODE:
return redirect(url_for('index', test_payment='success'))
try:
resp = requests.post(f"{BILLING_URL}/payment-link", headers=HEADERS, json={
"user_id": user_id, "amount": 0.001,
}, timeout=10)
payment_url = resp.json().get("payment_url")
The manifest describes an AI short video script generator, which clearly covers generating scripts, but the code also creates a database, stores generated scripts, lists prior scripts, retrieves individual saved scripts, and deletes them. Persistent CRUD management is additional behavior not reflected in the manifest description.
The HTML root sets lang="en", and the visible UI text throughout the page is English-only, with no indication that users can choose another language or that English is required for a region-specific purpose. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.
The template declares lang="en", which hard-codes English as the page language. Under the policy rule, forcing a specific language without user opt-in or documented regional justification is a natural-language policy violation.
No suspicious patterns detected.