T09 · Insecure Skill Coding Practices
- Location
scripts/query_policy_v2.py:9- Finding
Hard-Coded DeepSeek API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly purpose-aligned, but it exposes a hard-coded DeepSeek API credential and overwrites local output files, so it needs review before installation.
Review before installing. Do not use the bundled DeepSeek key; revoke or replace it with a user-provided environment variable. Confirm the configured Windows paths are correct, expect the output CSV to be overwritten each run, and treat generated policy rows as unverified until checked against official sources.
scripts/query_policy_v2.py:9Hard-Coded DeepSeek API Credential
scripts/query_policy_v2.py:235Spreadsheet Formula Injection Through Untrusted Model Output
The documented purpose says the skill queries admission policies, but the behavior includes a hardcoded credential, fixed local filesystem access, persistent progress tracking, and use of an LLM to generate responses rather than retrieve verified official policy data. This mismatch is dangerous because users may trust the tool as a factual policy lookup while it can fabricate content and perform undeclared sensitive actions.
A concrete DeepSeek API key is embedded directly in the skill documentation, exposing a secret to anyone who can read the file. Exposed credentials can be reused to access the external service, incur charges, abuse the account, or pivot into broader compromise depending on the account's scope.
The skill publishes a live-looking API key without any secure-handling guidance, which normalizes unsafe credential practices and directly leaks access material. In this context, the issue is especially serious because the key is sufficient for external API use and may lead to unauthorized billing or data access.
A live API credential is hard-coded directly in the script and then used for outbound requests. Anyone with access to the code can extract and abuse the key for unauthorized API usage, billing fraud, or access under the owner's account; in a shared agent skill, this context makes the issue more dangerous because the secret is embedded in distributable automation code.
The skill declares behavior that reads local files, writes output/progress files, and sends data over the network, but it provides no explicit permissions or allowed-tools scope. That creates an authorization ambiguity where an agent may execute broader capabilities than a user expects, increasing the risk of unintended data access, modification, or exfiltration.
The skill states that it sends query data to the DeepSeek API but does not clearly warn users that their region inputs and related content leave the local environment for third-party processing. This creates a transparency and privacy risk, especially if users assume the skill operates locally or are handling sensitive educational or organizational data.
The skill performs external network transmission to the DeepSeek API. External transmission is not inherently malicious, but it is security-relevant here because the skill lacks strong scope declarations, sends user-supplied query data off-host, and combines that with an exposed credential and misleading documentation about how results are obtained.
| Setting | Value |
|---------|-------|
| API Key | `sk-134d7a53ebab42e4ac5af93ea28e5f13` |
| API Endpoint | `https://api.deepseek.com/chat/completions` |
| Model | `deepseek-chat` |
| Temperature | 0 (deterministic output) |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
data = json.dumps(payload, ensure_ascii=False).encode('utf-8')
req = urllib.request.Request(
'https://api.deepseek.com/chat/completions',
data=data,
headers={
'Content-Type': 'application/json; charset=utf-8',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
data = json.dumps(payload, ensure_ascii=False).encode('utf-8')
req = urllib.request.Request(
'https://api.deepseek.com/chat/completions',
data=data,
headers={
'Content-Type': 'application/json; charset=utf-8',
The load_progress() function is documented as loading saved progress, implying the batch query can resume from a previous point. However, the main flow later hard-codes start_index = 0 and clears the output file on every run, so saved progress is never used and the process always restarts from the beginning.
Opening the output file in write mode truncates any existing data, which is a destructive file operation. The script prints that old data has been cleared only after performing the action, so users are not warned or asked to confirm before data loss occurs.
The activation description and the rest of the skill are narrowly scoped to Chinese education policy queries and are written primarily in Chinese, but there is no explicit opt-in or statement that the locale/language restriction is intentional for a region-specific tool. Under the language/locale policy rule, a forced locale should be clearly documented and justified or made optional.
The script contains save_progress() and load_progress() helpers for checkpointing, but the inline comment and code at start_index = 0 explicitly force a restart from the first record. This creates an intent-level inconsistency inside the file: the surrounding implementation suggests resumable processing, while the executed logic disables it.
Removing the progress file is an irreversible file deletion, and there is no advance warning or confirmation before it happens. The print statement appears only after deletion, so it does not serve as disclosure before the destructive action.