T09 · Insecure Skill Coding Practices
- Location
scripts/app.py:26- Finding
Production Payment API Key Exposed in Source Code and Documentation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill needs review because it advertises a paid WeChat scraping service, but the implementation is mostly demo data and exposes unsafe payment and web-server controls.
Treat this as a review-required prototype, not a production-ready scraper. Do not deploy it publicly or use real payment credentials until the exposed keys are rotated, secrets move to environment-managed storage, debug mode is disabled, payment verification is server-side, task ownership is enforced, and the documentation matches the actual demo-only scraping behavior.
scripts/app.py:26Production Payment API Key Exposed in Source Code and Documentation
scripts/app.py:21Payment Controls Can Be Bypassed by Forging Flask Session Cookies
scripts/app.py:206Missing Object-Level Authorization Exposes Other Users' Tasks and Articles
scripts/app.py:330Flask Development Debugger Is Exposed on All Network Interfaces
The documented behavior materially differs from the observed implementation, including fake or stubbed scraping, missing export features, placeholder metadata extraction, and inconsistent billing amounts. This is dangerous because users may authorize network, storage, or payment actions based on false representations, enabling deceptive charging, hidden functionality, or trust abuse.
The manifest exposes a hard-coded SkillPay API key in plaintext. Embedded secrets can be harvested by anyone with repository or package access and then abused for unauthorized payment operations, account takeover of the payment integration, fraudulent charges, or service disruption.
A live SkillPay API key is hard-coded directly in the application source, exposing a sensitive credential to anyone with code access. If leaked or reused, attackers could abuse the billing account, impersonate the service, or incur unauthorized charges and operational impact.
The skill advertises real WeChat article batch scraping/export, but the implementation only fabricates article metadata and content. Because payment enforcement is active, users can be charged for a capability the code does not actually provide, making this a deceptive and potentially fraudulent mismatch rather than a harmless placeholder.
The skill declares network access and local file-writing behavior implicitly through its documented scraping, export, and storage features, but it does not declare any explicit tool scope or permissions. Missing scope declarations reduce transparency and reviewability, making it easier for a skill to overreach or for users to invoke it without understanding its operational access.
The skill promotes bulk scraping, local storage, and export/downloading of third-party content and metadata without disclosing network collection behavior, retention practices, or copyright/privacy considerations. In a scraper context, this increases legal, privacy, and misuse risk because users may process content or metadata at scale without informed consent or safeguards.
The code explicitly sets Accept-Language to prioritize zh-CN/zh variants, which imposes a specific locale preference in outbound requests. There is no user opt-in, locale selection mechanism, or documented region-specific justification for forcing this language behavior.
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,
}, timeout=10)
data = resp.json()
The skill posts user_id, skill_id, and billing data to an external API, which is a network transmission of user-related data. Although exceptions are logged, there is no confirmation prompt or user-visible notice that this data is sent to a third-party billing endpoint.
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": 8,
}, timeout=10)
payment_url = resp.json().get("payment_url")
This endpoint sends a generated user_id and payment amount to a remote billing service to create a payment link. The code lacks a user-facing disclosure or warning that interacting with the skill causes payment-related data to be transmitted externally.
Comments and docstrings describe article parsing and scraping, but the code returns simulated data. This increases the risk of operator or user deception, especially in a paid tool, and can cause downstream systems to trust fabricated output as if it were collected from WeChat.
The manifest claims Markdown and HTML export support, but the code only implements Markdown and Excel export. Users may rely on advertised export formats that do not exist, which is especially problematic in a paid service and can break automated workflows expecting HTML.
The markdown export path writes scraped article content to disk and immediately serves the file back to the user. For code files, file-write operations should have at least some visible disclosure, but here there is no prompt, warning, print/log statement, or explanatory comment aimed at the user.
The Excel export path persists article metadata to a local .xlsx file, which is a file-write operation affecting user/system data storage. There is no visible warning, prompt, or documentation in this file informing users that exports are saved to disk.
The page explicitly states it returns simulated data and lacks real scraping logic, yet it still presents a payment flow and 'full-feature' scraping UX. In the context of a paid skill, this is a deceptive billing/trust issue that can induce users to pay for non-functional or materially misrepresented service behavior, increasing fraud and abuse risk.
This HTML/JS skill describes batch scraping of public-account articles and export to Markdown/Excel, but the user-facing text only lists features and does not disclose any potential privacy, legal, or system-impact considerations. Under SQP-2 for code files, network-backed data collection and export behavior should have some visible user disclosure when handling external content and generated datasets.
The document declares lang="zh-CN" and all visible user-facing text is presented only in Simplified Chinese. Under the language/locale policy, this is a natural-language constraint that should either offer user opt-in/choice or clearly document why the skill is region-specific.
SQP-3 applies to language or locale policy violations in natural-language content. The phrase '全中文界面' states a fixed language constraint, and the file does not offer opt-in language selection or explain that the tool is intentionally region-specific.
The document declares lang="zh-CN", and all visible UI text is Chinese, which effectively fixes the interface language for all users. The file does not indicate that this is an explicitly regional tool or provide any opt-in or alternative locale, which matches the language/locale policy concern described by SQP-3.
The manifest says the skill supports exporting scraped articles as Markdown/HTML, but this UI advertises and implements Markdown and Excel export buttons. This is a direct mismatch between the stated skill behavior and the functionality presented in code/documentation for this file.
No suspicious patterns detected.