Back to skill

Security audit

编程政策查找

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/query_policy_v2.py:9
Finding

Hard-Coded DeepSeek API Credential

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/query_policy_v2.py:235
Finding

Spreadsheet Formula Injection Through Untrusted Model Output

Content
View full analysis
= 4: parts = [] in_quote = False current = '' for ch in line: if ch == '"': in_quote = not in_quote elif ch == ',' and not in_quote: parts.append(current.strip().strip('"')) current = '' else: current += ch parts.append(current.strip().strip('"')) if len(parts) >= 5: while len(parts) < 5: parts.append('') records.append(parts[:5]) ``` The accepted values are then written directly to an Excel-compatible CSV file: ```python with open(OUTPUT_FILE, 'a', encoding='utf-8-sig', newline='') as f: writer = csv.writer(f) writer.writerows(limited) ``` ### Technical Analysis The DeepSeek response is external, untrusted content. All five parsed fields can contain values controlled by or derived from that response. The code validates only the number of comma-separated fields and applies limited stage-count filtering. It does not reject or neutralize cells beginning with spreadsheet formula indicators such as `=`, `+`, `-`, or `@`. The `csv.writer` module correctly escapes CSV syntax, but CSV quoting does not guarantee that spreadsheet applications will treat a value as plain text. When the generated `政策.csv` file is opened in Excel or another formula-capable spreadsheet applic ...[truncated 1853 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
100% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 36)May include surrounding context.

md
| Setting | Value |
|---------|-------|
| API Key | `sk-134d7a53ebab42e4ac5af93ea28e5f13` |
| API Endpoint | `https://api.deepseek.com/chat/completions` |
| Model | `deepseek-chat` |
| Temperature | 0 (deterministic output) |

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/policy_guide.md (reported line 89)May include surrounding context.

md
}
    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',

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/query_policy_v2.py (reported line 93)May include surrounding context.

python
}
    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',

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.