Back to skill

Security audit

Construction Mediation Kg

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Chinese construction-mediation assistant, but it needs Review because it can handle confidential legal data through external AI services and local plaintext storage, with one concrete provider-routing bug.

Install only after confirming you are comfortable with a Chinese-language legal-mediation workflow that may send prompts and case details to third-party AI services. Do not enter confidential client, party, evidence, or settlement-strategy data unless you have consent and have reviewed provider terms. Avoid the Zhipu provider until its implementation is corrected, use anonymized data for external calls, restrict filesystem access, and store case/evidence records in a protected location with encryption or equivalent controls.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/legal_ai_hub.py:109
Finding

Zhipu Credentials and Legal Case Data Are Misrouted Through the DashScope SDK

Content
View full analysis
Dict: try: import dashscope dashscope.api_key = self.api_key messages = [] if system_prompt: messages.append({"role": "system", "content": system_prompt}) messages.append({"role": "user", "content": prompt}) response = dashscope.Generation.call( model=self.model, messages=messages, result_format="message" ) ``` The following methods pass user-supplied legal information into that incorrectly configured API path: ```python def legal_search(self, issue: str) -> Dict[str, Any]: prompt = f"""As a construction-law expert, research: {issue} Requirements: cite specific provisions and explain practical considerations""" return self._call_api(prompt, self.SYSTEM_PROMPT) def analyze_case(self, description: str) -> Dict[str, Any]: prompt = f"""As a construction-dispute expert, analyze: {description} Output: disputed issues, legal analysis, and mediation recommendations""" return self._call_api(prompt, self.SYSTEM_PROMPT) def draft_document(self, doc_type: str, case_info: Dict) -> Dict[str, Any]: prompt = f"Generate {doc_type}: {json.dumps(case_info, ensure_asci ...[truncated 2237 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/case_manager.py:41
Finding

Confidential Case Records Are Persisted in Plaintext JSON Files

Content
View full analysis
str: return os.path.join(self.data_dir, f"{case_id}.json") def _save_case(self, case: MediationCase): """Save a case to a file""" filepath = self._get_case_file(case.case_id) with open(filepath, 'w', encoding='utf-8') as f: json.dump(self._serialize_case(case), f, ensure_ascii=False, indent=2) ``` ### Technical Analys ...[truncated 1797 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/evidence_manager.py:117
Finding

Evidence Metadata and Legal Conclusions Are Stored Without Encryption or Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/evidence_manager.py:139
Finding

Evidence Submission Reads Arbitrary Process-Accessible Files

Content
View full analysis
str: """Calculate a file hash""" if not os.path.exists(file_path): return "" hasher = hashlib.sha256() with open(file_path, 'rb') as f: for chunk in iter(lambda: f.read(4096), b""): hasher.update(chunk) return hasher.hexdigest() ``` ```python def submit_evidence(self, case_id: str, evidence_type: str, name: str, description: str, submitter: str, file_path: Optional[str] = None, notes: str = "") -> EvidenceItem: evidence_id = f"EV-{case_id}-{len(self.evidences)+1:03d}" file_hash = None file_size = None if file_path and os.path.exists(file_path): file_hash = self._calculate_hash(file_path) file_size = os.path.getsize(file_path) evidence = EvidenceItem( evidence_id=evidence_id, case_id=case_id, evidence_type=evidence_type, name=name, description=description, submitter=submitter, submit_date=datetime.now().strftime("%Y-%m-%d"), file_path=file_path, file_hash=file_hash, file_size=file_size, status=EvidenceStatus.SUBMITTED.value, notes=notes ) ``` ### Technical Analysis `file_path` is accepted directly from the caller. The implementation does not canonicalize it, constrain it to an upload directory, reject symlinks, verify that it is a regular file, or enforce a maximum size. The process consequently attempts to read and hash any existing path accessible under its current operating-system privileges. Even when file contents are not returned directly, the function exp ...[truncated 1587 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:291
Finding

Documentation Installs an Unpinned Third-Party AI Dependency

Content
View full analysis
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 (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a mediation-focused knowledge aid, yet it also supports multi-provider routing, external API calls, legal search, and provider failover. Hidden or under-declared networked behavior is dangerous because case facts, evidence summaries, or party information may be transmitted to third parties without operators recognizing that the skill is effectively an external-data-processing component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a mediation-focused knowledge aid, yet it also supports multi-provider routing, external API calls, legal search, and provider failover. Hidden or under-declared networked behavior is dangerous because case facts, evidence summaries, or party information may be transmitted to third parties without operators recognizing that the skill is effectively an external-data-processing component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a mediation-focused knowledge aid, yet it also supports multi-provider routing, external API calls, legal search, and provider failover. Hidden or under-declared networked behavior is dangerous because case facts, evidence summaries, or party information may be transmitted to third parties without operators recognizing that the skill is effectively an external-data-processing component.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code claims to implement a Zhipu GLM provider but actually uses the dashscope client path, creating provider confusion and potentially routing data to an unintended backend. In a legal context, misrouting sensitive case material undermines trust, breaks expected data-handling boundaries, and can cause compliance or contractual violations.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents capabilities that involve reading environment variables and performing file read/write operations, but it does not declare any explicit tool scope or permissions boundaries. This creates a least-privilege failure: an operator or orchestrator may expose broader capabilities than users expect, increasing the risk of unauthorized access to API keys, case materials, or persisted records.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger list includes broad terms such as general dispute-resolution phrases that may activate the skill outside the intended construction-mediation domain. Over-broad triggering is dangerous because it can route unrelated legal or sensitive requests into a skill with external integrations and persistence-oriented features, causing unnecessary data processing or leakage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document provides integration steps and examples for sending legal/case data to external AI services before giving a prominent warning about third-party transmission. In a mediation setting, case materials often contain confidential business and personal information, so insufficient up-front disclosure can result in unintentional privacy breaches and trust violations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document introduces case management, evidence management, and dashboard features that are operational and data-retentive, not merely knowledge-graph support. This scope drift matters because such features typically process sensitive legal records and create persistence, audit, and access-control requirements that are absent from the skill's stated trust model.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Case and evidence management functions are not obviously necessary for a mediation knowledge-graph skill, yet they imply handling highly sensitive dispute materials and potentially authoritative records. In this legal context, unnecessary collection and storage increases exposure to confidentiality breaches, tampering, and compliance issues.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest description and triggers are entirely Chinese without any documented locale constraint or user opt-in, which can force routing based on language-specific terms and exclude or mis-handle users in other languages. In a legal/mediation context, language mismatch can materially affect comprehension, accuracy, and consent, especially if users are routed into specialized guidance they did not intend to request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes generic dispute-resolution phrases such as "商事调解", "调解策略", and "争议解决", which can match many ordinary legal or business-support requests beyond the narrow intended scope of construction mediation. Overbroad routing can cause the wrong skill to activate, leading to irrelevant or overly specialized legal-style guidance being injected into general conversations and increasing the chance of unsafe or misleading advice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill is written in Chinese and presents all headings, examples, and guidance exclusively in that language. There is no indication that the skill is region-specific by policy or that users may opt into another language, which can violate a language/locale policy requiring user choice or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document is presented entirely in Chinese starting from the title, with no indication that language selection is optional or that the skill is intended only for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code persists full mediation case records, including parties, contacts, representatives, dispute details, notes, and document paths, to local JSON files on disk without any access control, encryption, retention policy, or user consent/notice. In the context of construction dispute mediation, this data is likely sensitive commercial and personal information, so silent local persistence increases the risk of unauthorized disclosure on shared hosts, developer workstations, or improperly secured deployments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file header and all user-facing descriptions are written exclusively in Chinese and frame the system as operating in that language/domain without any indication that users may choose another language. Under the policy rule, forcing a specific language without opt-in is a natural-language policy concern unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Natural-language comments, docstrings, prompts, and example output throughout the file are exclusively in Chinese, which effectively forces a specific language for users and maintainers. The file does not offer an opt-in choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module persists case evidence metadata to local disk and creates/manages a local storage directory, which exceeds a narrowly described knowledge-graph mediation advisory role and introduces undisclosed data-retention behavior. In a mediation context, stored evidence may contain sensitive legal, personal, or commercial information, so unnecessary persistence increases confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Evidence submissions are automatically serialized to evidences.json without any user-facing disclosure, confirmation, or retention notice. Because legal evidence data is often highly sensitive, silent persistence can violate user expectations and increase privacy, secrecy, and regulatory exposure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The submit_evidence flow accepts an arbitrary file_path and then checks existence, reads the file to hash it, and collects file size metadata. This creates a local file inspection primitive that can probe and process files outside the skill's stated mediation-analysis purpose, potentially exposing sensitive host information or enabling unauthorized access patterns if user input is attacker-controlled.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code sends user-supplied case descriptions, legal issues, and case metadata to a third-party LLM service (DashScope/Farui) without any visible consent, minimization, or privacy guardrails. In a legal mediation context, those inputs may contain highly sensitive personal, commercial, or dispute information, so undisclosed external transmission creates a real confidentiality and data-governance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code path transmits legal issues and case descriptions to an external API and returns results without warning the user that their input leaves the local skill boundary. Because this skill is intended for construction disputes and mediation, the data can include privileged, confidential, or strategically sensitive material, making silent transmission particularly risky.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a 建设工程商事调解知识图谱专家技能 focused on mediation strategy, dispute structuring, stakeholder analysis, BATNA/WATNA, process design, and mediation agreement drafting. In contrast, the abstract interface and concrete implementations provide broad legal-AI capabilities such as general legal retrieval, legal advice, case analysis, legal document drafting, and legal risk assessment, with no knowledge-graph behavior visible in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The system prompts and surrounding natural-language strings are written to operate exclusively in Chinese and position the assistant as a Chinese legal-domain tool, but there is no opt-in or documented explanation that the skill is intentionally locale-restricted. Under the policy, forcing a specific language without user choice or explicit justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The provider sends user-supplied legal and case content to an external LLM service, while the skill is presented as a mediation knowledge-graph expert. In a legal-dispute context, prompts may contain sensitive case facts, identities, contracts, or strategy, so undisclosed third-party transmission creates a real confidentiality and data-governance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

These methods package legal case descriptions and document-generation inputs and send them to a remote model without any user-facing warning. Because construction mediation data can include privileged facts, settlement posture, and personal or corporate confidential information, silent transmission materially increases privacy and confidentiality risk.

Content

No source excerpt is available for this finding.