Back to skill

Security audit

Legal Consulting Bundle

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Chinese legal-consulting web app, but it can send sensitive legal submissions to DeepSeek and expose an unprotected consultation endpoint without enough user notice or controls.

Review this skill carefully before installing or deploying. Do not submit confidential contracts, personal identifiers, trade secrets, or privileged legal material unless you are comfortable with external DeepSeek processing and have appropriate consent. If deploying it, add a visible privacy notice, explicit opt-in for third-party LLM use, redaction or minimization, authentication, rate limits, request-size limits, and updated dependencies.

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
main.py:82
Finding

Sensitive legal information is transmitted to an external LLM without explicit disclosure or consent

Content
View full analysis
str: """Call LLM API with fallback""" if not DEEPSEEK_API_KEY: return generate_fallback_response(system_prompt, user_prompt) try: async with httpx.AsyncClient(timeout=60) as client: resp = await client.post( DEEPSEEK_API_URL, headers={ "Authorization": f"Bearer {DEEPSEEK_API_KEY}", "Content-Type": "application/json", }, json={ "model": "deepseek-chat", "messages": [ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], "temperature": 0.2, "max_tokens": 4096, }, ) resp.raise_for_status() data = resp.json() return data["choices"][0]["message"]["content"] ``` The user-controlled question is passed to this function without redaction: ```python answer = await call_llm(system_prompt, question) ``` ### Technical Analysis When `DEEPSEEK_API_KEY` is configured, the application sends the complete user submission to `https://api.deepseek.com/v1/chat/completions`. The intended use cases include contract review, labor disputes, debt collection, intellectual property, and corporate compliance. Submissions may therefore contain: - Personal identifiers and contact information - Employment and health-related information - Confidential contract provisions - Financial and debt information - Litigation strategy or privileged legal communications - Trade secrets and internal corporate records No redaction, data ...[truncated 2015 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
main.py:365
Finding

Unauthenticated consultation endpoint permits paid API and resource abuse

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (16)

Known Vulnerable Dependency: jinja2==3.1.4 — 6 advisory(ies): CVE-2025-27516 (Jinja2 vulnerable to sandbox breakout through attr filter selecting format metho); CVE-2024-56201 (Jinja has a sandbox breakout through malicious filenames); CVE-2024-56326 (Jinja has a sandbox breakout through indirect reference to format method) +3 more

Critical
Category
Supply Chain
Confidence
96% confidence
Finding

Jinja2 3.1.4 is flagged with multiple sandbox breakout issues, which are especially dangerous if the application renders templates from untrusted input or relies on Jinja sandboxing for isolation. In an AI-powered legal service, any feature generating documents, contract reviews, or HTML/text reports from user-supplied content could become an avenue for template injection, arbitrary attribute access, or code-execution-adjacent compromise depending on usage.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 37)May include surrounding context.

bash
cd business/skill-bundles/legal-consulting-bundle
pip install -r requirements.txt
copy .env.example .env
py main.py
# 访问 http://localhost:8001

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

bash
pip install -r requirements.txt
copy .env.example .env
py main.py

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README promotes AI-driven legal analysis, contract review, and compliance checks without clearly warning that outputs are not formal legal advice and may be incomplete or jurisdiction-specific. In a legal workflow, users may upload contracts, dispute records, or personal/employer data; failing to warn about sensitive-data handling increases the risk of privacy exposure and overreliance on automated guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language description presents the skill as a Chinese legal consulting bundle and the document content is entirely in Chinese, without indicating that users may choose another language or explicitly opt into a Chinese-only experience. This can be a language/locale policy violation when no choice or justification is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly requests Write, WebSearch, and WebFetch capabilities but does not disclose that it may modify local files or retrieve external content. In a legal-consulting context, users may provide sensitive documents and assume analysis-only behavior, so undisclosed write/network actions increase the risk of unintended data exposure, persistence, or system changes.

Content

No source excerpt is available for this finding.

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

python
templates = Jinja2Templates(directory=str(TEMPLATES_DIR))

DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY", "")
DEEPSEEK_API_URL = "https://api.deepseek.com/v1/chat/completions"


# ==================== Knowledge Base ====================

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-submitted legal questions are sent verbatim to an external LLM provider, and those questions may contain highly sensitive personal, employment, contract, or dispute information. In a legal-consulting context this is especially risky because users may reasonably expect confidentiality similar to professional legal intake, yet this file provides no consent flow, warning, minimization, or redaction before transmission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Multiple system prompts explicitly instruct the model to '请用中文回复', making Chinese mandatory regardless of the user's language preference. This is a natural-language locale policy issue because the file does not offer any language selection, opt-in, or documented justification that the skill must operate only in Chinese.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: python-dotenv==1.0.1 — 2 advisory(ies): CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)

Medium
Category
Supply Chain
Confidence
84% confidence
Finding

The dependency is pinned to a version reported as affected by a file-handling flaw in python-dotenv's set_key behavior involving symlink following. If this skill or a related maintenance path ever writes .env values in a writable or attacker-influenced location, an attacker could potentially overwrite arbitrary files reachable through symlinks. In a legal consulting service that may handle sensitive client and business data, that can contribute to configuration compromise or service tampering.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The page declares lang="zh-CN" and all visible UI text is presented in Chinese, with no language selector or indication that the user can choose another locale. This is a natural-language policy concern when a skill enforces a specific language without explicit user opt-in or documented justification in the file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The page collects free-form legal questions and contract text, which are likely to contain sensitive personal, employment, corporate, or dispute-related data, and sends them to the backend with no privacy or data-handling disclosure beyond a legal-quality disclaimer. In a legal-consulting context, users may reasonably submit highly confidential material, so the lack of notice and consent increases privacy, compliance, and trust risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The README states the product is based on Chinese legal knowledge, but it does not prominently explain that its applicability is limited to PRC law and may be unsuitable for users, contracts, or disputes involving other jurisdictions. This can mislead users into applying answers outside the intended legal framework, causing incorrect legal decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file presents all content exclusively in Chinese and does not indicate that language selection is optional or that the file is intended only for a Chinese-speaking or China-specific context. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.