T09 · Insecure Skill Coding Practices
- Location
scripts/polish.R:10- Finding
Hardcoded Moonshot API Credential in polish.R
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly aligned with polishing literature reviews, but it embeds a real-looking API key and sends user drafts to an external AI service with limited disclosure.
Review this carefully before installing. Do not use it with confidential, unpublished, regulated, or student-identifying drafts unless you are comfortable sending the text to Moonshot/Kimi. The publisher should revoke the exposed API key, remove it from both scripts, require users to provide their own key through environment configuration, and warn before saving output files.
scripts/polish.R:10Hardcoded Moonshot API Credential in polish.R
scripts/polish.R.R:10Hardcoded Moonshot API Credential in Duplicate polish.R.R Script
User-supplied literature review text is transmitted to an external API with no warning, consent, or privacy notice. Because academic drafts can contain unpublished ideas, identifiable student data, or proprietary research, silent transmission to a third party creates a substantial confidentiality and compliance risk.
All user-facing prompts, instructions, and expected interaction flow are hard-coded in Chinese, which imposes a specific language on users without opt-in. The file does not document that this is a China-specific or Chinese-only tool, nor does it provide a way to choose another language.
The file contains a hardcoded live-looking API key alongside the external endpoint. Embedding secrets directly in source code risks credential theft through repository exposure, reuse by unauthorized parties, unexpected billing, and abuse of the linked account.
# ========== 请在这里填写你的API信息 ==========
KIMI_API_KEY <- "sk-kwe4WnYviimoCDIXOXgG82Xh91c9hWSNNobXj3OMUvfabOSF"
KIMI_BASE_URL <- "https://api.moonshot.cn/v1"
# ===========================================
# 调用Kimi API进行润色
The skill sends the user's full literature review to a third-party API, which exceeds a simple local 'polish and improve' expectation and creates an undisclosed data-sharing boundary. Literature reviews may contain unpublished research, student work, or confidential material, so transmitting them externally without explicit disclosure can expose sensitive intellectual property and personal data.
The API-generated result is automatically written to disk without prior warning or confirmation. This creates an unnecessary persistence channel for potentially sensitive academic content and may violate user expectations, especially on shared machines or managed environments.
User-facing prompts, instructions, and model prompts are all hard-coded in Chinese, and the script does not provide any mechanism to select another language or locale. This creates a natural-language policy concern because it imposes a specific language on users without explicit opt-in.
The file contains a hardcoded API key alongside the external service endpoint, which exposes a live credential to anyone with access to the skill source. Hardcoded secrets can be abused for unauthorized API usage, billing fraud, service impersonation, and potential access to submitted user content or account metadata depending on provider permissions.
# ========== 请在这里填写你的API信息 ==========
KIMI_API_KEY <- "sk-kwe4WnYviimoCDIXOXgG82Xh91c9hWSNNobXj3OMUvfabOSF"
KIMI_BASE_URL <- "https://api.moonshot.cn/v1"
# ===========================================
# 调用Kimi API进行润色
User-supplied literature review text is sent to an external API service without an explicit warning, consent step, or privacy notice. Academic drafts may contain unpublished research, sensitive personal data, or proprietary material, so silent transmission to a third party creates confidentiality and compliance risks.
The manifest describes a text-improvement skill for students and researchers, which implies analysis and rewriting of user-provided text. At L175-L178, the code additionally persists output to disk without that storage behavior being reflected in the stated description, expanding behavior beyond simple polishing.
The script automatically saves polished output to a local file without advertising this behavior in the skill description. This can leave potentially sensitive academic content on disk unexpectedly, increasing the chance of unauthorized access, backup leakage, or accidental sharing on multi-user systems.
This code saves the generated output to a timestamped file as a side effect of running the full report. While the save location is shown afterward, there is no advance warning or confirmation before the file write occurs.
A dedicated connection-testing routine sends a probe request to the external model API independent of any literature review task. While not inherently dangerous, this capability is not justified by the manifest's stated purpose of polishing literature reviews.