T09 · Insecure Skill Coding Practices
- 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
