T09 · Insecure Skill Coding Practices
- Location
search.py:7- Finding
Hard-Coded API Credential in Executable Source Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a finance-news search skill, but it ships a reusable API key and sends searches to a third-party service, so it needs review before installation.
Install only if you are comfortable with finance search terms being sent to the listed third-party API. The publisher should rotate the exposed API key, remove it from the package and documentation, and narrow the generic news trigger before this is treated as a routine install.
search.py:7Hard-Coded API Credential in Executable Source Code
SKILL.md:13API Credential Disclosed in Skill Documentation
The invocation example "看看今天有什么新闻" is a generic, everyday request for news and is not clearly constrained to A-share or finance topics. This broad phrasing could cause unintended skill activation outside the intended domain.
The skill embeds a live API key directly in the documentation and instructs clients to send user-supplied queries to an external third-party endpoint. Hardcoded credentials can be harvested and abused, and the external transmission of potentially sensitive user prompts or investment-related interests creates confidentiality and misuse risks.
curl -X POST "https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search" \
-H "Content-Type: application/json" \
-H "apikey: mkt_o2fBS-Dkbt11c7vSNnlXjESgfybI8EXzzzX2XkOQVuE" \
-d '{"query":"<搜索关键词>","variables":0}'
The file embeds a live static API key directly in source code, which is a credential exposure issue regardless of the docstring. Hardcoded secrets are easily leaked through source control, logs, package distribution, or reuse, enabling unauthorized API access, quota exhaustion, and possible access to associated backend data or billing.
The code accesses a hardcoded API credential with no protection or explanation, which is a direct secret-management failure. Anyone obtaining the code can reuse the credential to impersonate the skill, consume service quotas, or access any data and privileges tied to that key.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"size": size
}
resp = requests.post(API_URL, headers=headers, json=data, timeout=30)
result = resp.json()
if result.get("status") != 0:
This code posts the user's search query to a remote service, which is a data-transmitting network operation covered by the warning requirement for code files. There is no confirmation prompt, user-facing log/print, or explanatory comment/docstring disclosing that the query is sent to an external endpoint.
The top-level natural-language description is only in Chinese and does not offer any language or locale choice. Under the policy rule, forcing a specific language without user opt-in can be a locale/language policy issue.
Detected: suspicious.exposed_secret_literal