T09 · Insecure Skill Coding Practices
- Location
llm_integration.py:47- Finding
Optional Remote LLM Providers Transmit Source Code and Security Finding Data Contrary to Local-Only Privacy Claims
- Content
View full analysis
Vulnerability Details
File Location:
llm_integration.py:47-49,llm_integration.py:79-94,llm_integration.py:140-154,llm_integration.py:207-229, andllm_integration.py:235-253
Vulnerability Type: Sensitive source-code and security-data disclosure to third-party LLM services
Risk Level: HighVulnerable Code
The vulnerability-analysis method incorporates source code and context into an LLM prompt:
python prompt = self._build_vulnerability_analysis_prompt(code, vuln_type, context) response = self._call_llm(prompt) return self._parse_vulnerability_analysis(response)The generated prompt includes the supplied source-code content:
python return f"""You are a professional code security auditor. Analyze whether the following code contains a {vuln_type} vulnerability. ## Code Snippet ```python {code}Context
{context if context else "No additional context"} """
text Finding analysis similarly incorporates evidence and surrounding code: ```python return f"""Analyze whether the following security warning is a false positive. ## Finding - Type: {finding.get('type', 'unknown')} - File: {finding.get('location', {}).get('file', 'unknown')} - Line: {finding.get('location', {}).get('line', 0)} - Evidence: {finding.get('evidence', '')} ## Code Context {finding.get('context', 'No context')} """The Qwen provider sends the resulting prompt to Alibaba DashScope:
python def _call_qwen(self, prompt: str) -> str: url = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation" headers = { "Authorization": f"Bearer {self.config.api_key}", "Content-Type": "application/json" } payload = { "model": self.config.model, "input": { "messages": [ {"role": "user", "content": prompt} ] }, "parameters": { ...[truncated 3412 chars]- Remediation
View remediation
Remediation Suggestions
- Remove unconditional claims that all processing is local and that source code never leaves the environment.
- Clearly identify Ollama as local and Qwen/ChatGLM as remote providers in
SKILL.md,README.md, andskill.yaml. - Require explicit informed consent before enabling any remote provider.
- Display the destination, categories of transmitted data, and applicable privacy implications before the first remote request.
- Redact secrets before prompt construction, including API keys, passwords, bearer tokens, private keys, cloud credentials, and scanner evidence.
- Minimize prompts to the smallest source fragment required for analysis.
- Add an egress-disabled configuration that is enabled by default.
- Enforce an allowlist of approved HTTPS destinations and reject arbitrary base URLs for remote operation.
- Add tests proving that remote requests cannot occur without explicit opt-in and that sensitive evidence is removed before transmission.
- Consider separating remote-provider support into an optional package so that a local-only installation has no external analysis path.
