T09 · Insecure Skill Coding Practices
- Location
clean_and_eval.py:17- Finding
Hard-Coded MiniMax API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill performs the advertised disclosure collection work, but it needs review because it includes hardcoded API credentials, under-disclosed third-party AI uploads, weakened browser security, and unsafe download handling.
Install only if you are comfortable with a crawler that contacts many external company sites, downloads public disclosure files, may send document contents or images to third-party AI services, and mutates a persistent ontology file. The publisher should remove and rotate embedded API keys, require explicit opt-in for external AI processing, restore normal browser security settings or isolate the crawler, and harden URL and filename validation before broad use.
clean_and_eval.py:17Hard-Coded MiniMax API Credential
parser.py:40Hard-Coded GLM API Credential
clean_and_eval.py:35Automatic Transmission of Collected Documents to Third-Party AI Services
collect.py:166Path Traversal Through Website-Controlled Attachment Filenames
phase2_parse.py:38Server-Side Request Forgery Through Unvalidated Announcement URLs
collect.py:34Chromium Security Boundaries Disabled While Visiting Untrusted Websites
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
},
method="POST",
)
with urllib.request.urlopen(req, timeout=60) as resp:
result = json.loads(resp.read())
status = result.get("base_resp", {}).get("status_code", -1)
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Referer": referer,
})
with urllib.request.urlopen(req, timeout=20, context=ctx) as r:
data = r.read()
# 用 URL hash 做文件名,保留扩展名
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
# ── 优先:GLM-4V-flash(视觉+文本结构化提取) ─────────────────────────
if image_base64:
try:
resp = httpx.post(
GLM_API_URL,
headers={"Authorization": f"Bearer {GLM_API_KEY}", "Content-Type": "application/json"},
json={"model": "glm-4v-flash", "messages": messages, "max_tokens": max_tokens},
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
# ── GLM-4-flash(纯文本) ──────────────────────────────────────────────
for glm_model in ["glm-4-flash", "glm-4v-flash"]:
try:
resp = httpx.post(
GLM_API_URL,
headers={"Authorization": f"Bearer {GLM_API_KEY}", "Content-Type": "application/json"},
json={"model": glm_model, "messages": messages, "max_tokens": max_tokens, "temperature": temperature},
A live API credential appears hardcoded as the default value for MINIMAX_API_KEY. Anyone with access to this file or a redistributed copy can reuse the key for unauthorized API calls, incur billing, or access associated service activity, and the key may persist in version control history even if later removed.
The embedded OCR API key is a direct secret exposure. Beyond unauthorized use and billing abuse, distributing this script leaks a credential into downstream environments and archives, making incident response harder because copies may persist outside the original repository.
A hardcoded GLM API credential embeds standing access to an external service directly in the source code, enabling unauthorized reuse if the file is exposed, shared, or committed. In the context of a parser skill, this also silently grants external transmission capability beyond what users may expect from local text processing.
The code contains a hardcoded API credential, which is a direct secret-management failure. Anyone with access to the repository, packaged skill, logs, or backups may recover and abuse the credential for unauthorized API usage, billing impact, or access to associated service data.
The parser sends announcement text, metadata, and optionally images to an external LLM API, which creates a clear data egress path to a third party. In a parsing skill, this may expose sensitive or regulated source content, and the code does not provide meaningful notice, consent, data classification, redaction, or provider restrictions before transmission.
The skill explicitly documents downloading remote content and writing announcements, extracted text, and attachments into local workspace directories, but it does not warn the user about persistent filesystem modification or storage growth. This creates a real safety issue because running the skill can unexpectedly alter the local environment, consume disk space, and retain potentially sensitive or untrusted files from external websites.
The skill states that Phase 3 writes extracted entities into a shared persistent ontology file under memory/ontology/graph.jsonl, yet it does not warn that execution mutates shared long-lived knowledge state. This is dangerous because imported data from scraped external sources can contaminate or poison downstream knowledge, affect unrelated workflows, and be difficult to audit or roll back once merged into shared storage.
The top-level documentation describes the phase as data cleaning, content evaluation, and image OCR, which suggests local processing of Phase 1 outputs. In implementation, the script additionally fetches image URLs over the network and uploads image contents to MiniMax via HTTP requests, a materially broader operational behavior not reflected in the docstring.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"MINIMAX_API_KEY",
"sk-cp-CT_VXVxvL9Eu71Wnp5NjLO6RatHKPker4laUs67t24Cmhk56xEOSyeU5-pHkjxJkLiFCvK8_AA7QY0g3MBAPWkzXRl1AnZiQBjPdvOCSRVQq4GDWElDPEUY",
)
MINIMAX_TEXT_URL = "https://api.minimax.chat/v1/text/chatcompletion_v2"
MINIMAX_VLM_URL = "https://api.minimax.chat/v1/coding_plan/vlm"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"MINIMAX_API_KEY",
"sk-cp-CT_VXVxvL9Eu71Wnp5NjLO6RatHKPker4laUs67t24Cmhk56xEOSyeU5-pHkjxJkLiFCvK8_AA7QY0g3MBAPWkzXRl1AnZiQBjPdvOCSRVQq4GDWElDPEUY",
)
MINIMAX_TEXT_URL = "https://api.minimax.chat/v1/text/chatcompletion_v2"
MINIMAX_VLM_URL = "https://api.minimax.chat/v1/coding_plan/vlm"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"MINIMAX_API_KEY",
"sk-cp-CT_VXVxvL9Eu71Wnp5NjLO6RatHKPker4laUs67t24Cmhk56xEOSyeU5-pHkjxJkLiFCvK8_AA7QY0g3MBAPWkzXRl1AnZiQBjPdvOCSRVQq4GDWElDPEUY",
)
MINIMAX_TEXT_URL = "https://api.minimax.chat/v1/text/chatcompletion_v2"
MINIMAX_VLM_URL = "https://api.minimax.chat/v1/coding_plan/vlm"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"MINIMAX_API_KEY",
"sk-cp-CT_VXVxvL9Eu71Wnp5NjLO6RatHKPker4laUs67t24Cmhk56xEOSyeU5-pHkjxJkLiFCvK8_AA7QY0g3MBAPWkzXRl1AnZiQBjPdvOCSRVQq4GDWElDPEUY",
)
MINIMAX_TEXT_URL = "https://api.minimax.chat/v1/text/chatcompletion_v2"
MINIMAX_VLM_URL = "https://api.minimax.chat/v1/coding_plan/vlm"
The function base64-encodes downloaded images and sends them to an external OCR service without any explicit consent, notice, or policy gate. If those images contain regulated, confidential, or personal information, normal use of the script causes unintended third-party disclosure and possible compliance violations.
This Python file contains natural-language instructions, help text, and runtime messages exclusively in Chinese, starting from the module docstring and continuing through the CLI interface. Under the stated policy, forcing a specific language without offering a language or locale choice is a natural-language policy violation.
The function documentation says detail-page attachments are stored under each announcement's content/{id}/attachments/ directory. However, _download_attachment derives its destination from Path(sys.argv[0]).parent and creates a generic attachments directory there, with no caller override, so attachments fetched via _extract_attachments are not saved to the per-item path described by the docstring.
The argparse description, help strings, examples, and printed status messages are all presented only in Chinese. The file does not offer an alternate locale, opt-in mechanism, or explicit justification that the skill is restricted to Chinese-language users only.
Multiple collectors navigate to remote websites, read full page text, intercept network responses, and directly call external APIs using page.request, but the file does not include any confirmation prompt or explicit disclosure that user/system network activity and retrieved content will be sent to external services. While some logging exists for counts and progress, it does not warn about the privacy or integrity implications of automated remote collection.
The docstring at L1078-L1082 describes a fallback strategy of waiting for Cloudflare and otherwise returning an empty list for html_dom to handle. However, the code immediately installs a response listener at L1088-L1102 and captures JSON from matching API responses, which is a materially different data-collection method than the documentation describes.
This JSON manifest contains natural-language strings stating the configuration is for '30家消费金融公司信息披露采集配置' and that all collection entrypoints should use this file, but it provides no indication that Chinese-language behavior is optional or region-specific by design. Under the policy, forcing a specific language or locale without user opt-in can be a natural-language policy violation unless the constraint is explicitly justified.
The script claims to only diagnose company disclosure pages, but the Playwright browser is launched with flags that disable important protections such as web security and certificate validation. If one of the target sites is compromised or intercepted, the browser may accept malicious content or invalid TLS sessions and interact with it under weaker isolation than expected.
This code file performs external network access by navigating an automated browser to third-party company websites, which transmits system/browser metadata and triggers page loads. Although the script prints the target URL after starting diagnosis, it does not provide a prior warning, confirmation, or inline documentation explaining that live network requests will be made to external domains.
No suspicious patterns detected.