T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/main.py:17
- Finding
- Undisclosed Transmission of Sensitive User Documents to a Third-Party API<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py:17, 105-119, 178-180, 35-47` **Vulnerability Type**: Sensitive data exposure to an external service **Risk Level**: High ### Vulnerable Code ```python API_URL = "https://api2.aigcbest.top/v1/chat/completions" ``` ```python # Read all supplied files battle_map_content = read_file_content(args.battle_map_file) meeting_notes_content = read_file_content(args.meeting_notes_file) product_info_content = read_file_content(args.product_info_file) benchmark_content = read_file_content(args.benchmark_script_file) competitor_content = read_file_content(args.competitor_script_file) historical_content = "" if args.historical_script_files: for f in args.historical_script_files: content = read_file_content(f) if content: historical_content += f"\n--- Historical script: {os.path.basename(f)} ---\n{content}\n" ``` ```python if args.call_model: messages = [{"role": "user", "content": prompt}] try: generated_scripts = asyncio.run(model_gpt(messages)) ``` ```python async with session.post( API_URL, headers={ 'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json' }, data=json.dumps({ "model": model, "messages": message_list, "max_tokens": 12000, "temperature": 0 }), timeout=999 ) as response: ``` ### Technical Analysis The application reads the complete contents of battle maps, meeting notes, product descriptions, benchmark scripts, competitor scripts, historical scripts, and other user-provided information. These values are incorporated into a single prompt and sent to the hard-coded external endpoint `api2.aigcbest.top`. The skill documentation only describes `--call-model` as directly invoking a model. It does not identify the external recipient, explain which information will leave the local system, describe retention ...[truncated 1602 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Clearly disclose the external API hostname, provider identity, transmitted data categories, retention policy, and privacy implications before execution. 2. Require explicit, informed user approval immediately before any network transmission. 3. Make the model endpoint configurable and restrict it to an administrator-approved provider allowlist. 4. Add a local-only mode that never transmits document contents. 5. Minimize the transmitted data and redact secrets, personal information, and confidential metadata before constructing the request. 6. Display a redacted transmission preview showing which files and fields will be sent. 7. Apply transport and provider-security controls, including certificate validation, contractual data-processing safeguards, and documented retention limits. 8. Reject model invocation when the destination has not been explicitly configured and approved. ]]>
