T09 · Insecure Skill Coding Practices
- Location
scripts/handler.py:76- Finding
Unrestricted Local Audio File Read and External Disclosure
- Content
View full analysis
dict: """Main entry point for Gemini Assistant.""" chat_id = request_data.get("chat_id", "unknown") text_input = request_data.get("text") audio_path = request_data.get("audio_path") system_instruction = request_data.get("system_instruction") safe_id = str(chat_id).replace("@", "_").replace("+", "").replace(".", "_") voice_output_path = f"/tmp/gemini_voice_{safe_id}.ogg" try: # Process with Gemini result = asyncio.run(_process_with_gemini( audio_path=audio_path, text_input=text_input, system_instruction=system_instruction )) ``` ### Technical Analysis The handler accepts `audio_path` directly from `request_data` and passes it to `librosa.load()` without verifying that the path belongs to an authorized upload directory. The implementation does not canonicalize the path, reject symbolic links, check file ownership, enforce an allowlisted file type, or verify that the caller is authorized to access the selected file. If the process can decode the selected file as audio, its contents are converted to PCM and transmitted to the external Gemini Live API. Consequently, this is not only a local file-read issue but also an external data-disclosure path. Exploitat ...[truncated 1247 chars]- Remediation
View remediation
