Back to skill

Security audit

师爷 - 三模型交叉评审

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a legitimate AI review tool, but it uploads user-provided documents or code to a configurable external API without strong disclosure, destination validation, or explicit consent.

Install only if you are comfortable sending reviewed content to the configured external model endpoint. Do not use it on confidential code, resumes, emails, business documents, or regulated data without approval. Prefer a trusted HTTPS endpoint, avoid placing real keys directly in the source file, use a limited API key, and treat the optional openpyxl install as unnecessary unless Excel support is actually added.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
shiye.py:14
Finding

Unrestricted API Endpoint Can Exfiltrate Documents and API Credentials

Content
View full analysis

Vulnerability Details

File Location: shiye.py, lines 14-20, 47-58, and 97-119
Vulnerability Type: Unrestricted transmission of sensitive information to a configurable network endpoint
Risk Level: Medium

Vulnerable Code

python
# ⚠️ 把你的 API Key 填在这里(必填)
API_KEY = "sk-your-api-key-here"

# 模型服务地址(一般不用改)
API_BASE = "https://api.deepseek.com/v1"

# 也可以用环境变量(优先)
API_KEY = os.environ.get("SHIYE_API_KEY", API_KEY)
API_BASE = os.environ.get("SHIYE_API_BASE", API_BASE)
python
def call_model(model_id: str, prompt: str) -> str:
    body = json.dumps({
        "model": model_id,
        "messages": [
            {"role": "system", "content": "你是JSON输出机器人。只输出JSON,绝不输出Markdown、解释或报告。违反则任务失败。"},
            {"role": "user", "content": prompt}
        ],
        "temperature": 0,
        "max_tokens": 2000,
    }).encode()
    req = Request(
        f"{API_BASE}/chat/completions",
        data=body,
        headers={"Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}"},
    )
    try:
        with urlopen(req, timeout=300) as resp:
            return json.loads(resp.read())["choices"][0]["message"]["content"]
python
prompt = f"""你是 AI 质量评审专家。对照以下标准,逐条打分(1-5分),给出扣分理由。

=== 评分标准 ===
{criteria_text}

=== 待评审内容(以下为完整文件内容,无截断) ===
{sample_content[:16000]}

=== 输出格式 ===
只输出 JSON:{{"scores":[{{"criterion":"<标准名>","score":<1-5>,"reason":"<理由>"}}],"overall":<平均分,1位小数>,"top_issue":"<最严重问题>","note":"<建议,30字内>"}}
只输出 JSON。不要 Markdown、不要报告、不要解释。违反指令=失败。"""

Technical Analysis

The remote model requests necessarily contain the material being reviewed, including up to 16,000 characters of the selected file. The request also carries the configured API key as a bearer credential.

Remote inference is consistent with the Skill's declared purpose. However, the destination is taken directly from the `SHI ...[truncated 1890 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require an https:// URL and reject plaintext HTTP or unsupported schemes.
  2. Use an allowlist of approved API hostnames by default.
  3. If custom endpoints are required, make them an explicit opt-in and require user confirmation before the first transmission.
  4. Resolve and validate redirects so an approved endpoint cannot redirect requests to an untrusted destination.
  5. Display the destination hostname and the amount of content that will be uploaded before making a request.
  6. Clearly document that selected file contents are sent to an external service and may be retained under that provider's policies.
  7. Offer content redaction, local preprocessing, and a configurable upload limit for sensitive documents.
  8. Do not encourage users to place real secrets directly in source code. Obtain credentials from a protected secret store or environment variable.
  9. Use separate credentials with minimal provider permissions, quotas, and rotation support.
  10. Consider requiring explicit consent for each new destination and each file classified as potentially sensitive.

T08 · Insecure Dependencies

Note
Location
SKILL.md:17
Finding

Unpinned and Unnecessary Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 17-20
Vulnerability Type: Unpinned dependency installation from a mutable package source
Risk Level: Low

Vulnerable Code

bash
pip install --user openpyxl  # Optional, only required for Excel review

Technical Analysis

The installation instructions tell users to install the latest available openpyxl release and its transitive dependencies without a version constraint, lock file, integrity hash, or reviewed package index configuration. This means the installed code can change over time without any corresponding change to the audited Skill.

The dependency appears unnecessary for the audited implementation: shiye.py does not import openpyxl and contains no Excel-specific parsing logic. Asking users to install unused software unnecessarily expands the local dependency and supply-chain attack surface.

This finding does not establish that the named package is malicious. The risk arises from uncontrolled future versions, mutable transitive dependencies, package-index compromise, and installation from an improperly configured or attacker-controlled Python package source.

Attack Path

  1. A user follows the installation command in SKILL.md.
  2. pip resolves the latest package and transitive dependency versions available from its configured index.
  3. A future compromised release, compromised transitive dependency, or attacker-controlled package index supplies malicious installation artifacts.
  4. Package build or installation logic executes under the user's account, or malicious code becomes available for later import.
  5. The malicious dependency gains the same local access as the user running pip or the consuming application.

Impact Assessment

If a fetched dependency were compromised, installation-time or runtime code could operate with the permissions of the user executing the command. Depending on that user's access, this co ...[truncated 340 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the openpyxl installation instruction unless Excel parsing is actually implemented and requires it.
  2. If the dependency becomes necessary, pin a reviewed version rather than installing an unrestricted latest release.
  3. Pin and review all transitive dependencies through a lock file.
  4. Publish cryptographic hashes and install with pip --require-hashes.
  5. Use a trusted, explicitly configured package index and secure TLS verification.
  6. Periodically scan pinned dependencies for known vulnerabilities and update them through a controlled review process.
  7. Install optional dependencies in an isolated virtual environment rather than the user's global package location.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tainted flow: 'req' from os.environ.get (line 57, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · shiye.py (reported line 63)May include surrounding context.

python
headers={"Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}"},
    )
    try:
        with urlopen(req, timeout=300) as resp:
            return json.loads(resp.read())["choices"][0]["message"]["content"]
    except Exception as e:
        raise RuntimeError(f"API调用失败 ({model_id}): {e}")

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented purpose does not fully match the described behavior: local files are read, review criteria may be generated automatically, and content is sent to a remote DeepSeek-compatible endpoint while presenting the feature as a three-model review engine. This can mislead users about where their data goes, what processing occurs, and whether multiple independent providers are actually involved, creating privacy and trust risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill invites users to submit documents, code, resumes, and emails for review but does not clearly warn that this material will be transmitted to an external AI API. That omission is dangerous because users may unknowingly expose proprietary, personal, or confidential data to a third party.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README presents the skill entirely in Chinese and gives only a Chinese invocation phrase, with no indication that users may choose another language. This can be a language/locale policy issue when the skill appears to require a specific language without offering opt-in or alternatives.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrase shown to users is extremely generic ('师爷,帮我评审一下这个' / effectively 'help me review this'), making accidental invocation or collision with normal conversation plausible. In an agent setting, broad triggers can cause unintended skill activation on arbitrary content, which may expose user data to external model APIs or produce actions the user did not explicitly intend.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises executable behavior that involves reading local files, accessing environment variables, and making network requests, but it does not declare any explicit tool scope or permissions. This weakens reviewability and user consent because consumers cannot easily tell that local content and secrets may be used and transmitted externally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill name, description, and user-facing documentation are entirely in Chinese, and there is no indication that users may choose another language or locale. This can violate language/locale policy when a skill implicitly constrains interaction language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

Referencing a remote API endpoint is not inherently unsafe, but in this context it indicates external transmission of user-supplied review content to a third-party service. Because the skill handles potentially sensitive documents and does not pair this with strong disclosure and consent, the endpoint materially contributes to a privacy and data-exposure risk.

Content

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

bash
export SHIYE_API_KEY="your-deepseek-api-key"
export SHIYE_API_BASE="https://api.deepseek.com/v1"

或在 shiye.py 第 14 行直接填入。

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The documented default API base confirms that the skill is designed to communicate with an external service. In a workflow involving code, resumes, emails, and documents, undisclosed external transmission can expose confidential material and create compliance issues.

Content

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

md
| 环境变量 | 说明 | 默认值 |
|----------|------|--------|
| `SHIYE_API_KEY` | DeepSeek API Key | 空 |
| `SHIYE_API_BASE` | API 地址 | `https://api.deepseek.com/v1` |

## 注意事项

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 · shiye.py (reported line 17)May include surrounding context.

python
API_KEY = "sk-your-api-key-here"

# 模型服务地址(一般不用改)
API_BASE = "https://api.deepseek.com/v1"

# 也可以用环境变量(优先)
API_KEY = os.environ.get("SHIYE_API_KEY", API_KEY)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill advertises independent three-model cross-review using Kimi, GLM, and Qwen, but all requests are sent through a single DeepSeek-compatible endpoint with one shared credential. This is a supply-chain and trust-boundary mismatch: users may disclose sensitive content believing it is distributed across separate providers when it is actually routed to one service, undermining transparency, auditability, and privacy expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The main review flow embeds up to 16,000 characters of the sample directly into prompts sent to external APIs without user-facing disclosure or opt-in. Because the advertised use cases include code, documents, and resumes, the skill materially increases the chance of leaking proprietary source, personal data, or internal business information to third-party services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

When no criteria file is provided, the script automatically sends sample content to an external model to infer review criteria, but it does not clearly warn the user first. In this skill context, users may upload resumes, code, or documents that contain confidential or regulated data, so silent transmission to a third-party API creates a real privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language instructions, usage text, and model prompts are all written to operate in Chinese, with no indication that another language can be selected. This can violate language/locale policy when a skill imposes a specific language without user choice or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The docstring states '评审流程由 Agent 在对话中完成,脚本只管执行评审', implying a narrow executor role. However, the script also analyzes input type, auto-generates review criteria, dispatches multiple model calls, aggregates results, and derives consensus, which is broader than the documented role.

Content

No source excerpt is available for this finding.