T09 · Insecure Skill Coding Practices
- Location
scripts/dubbing.py:119- Finding
Translation API Credential Forwarded to an Independently Configurable Vision Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
scripts/dubbing.py:30-37,scripts/dubbing.py:119-131
Vulnerability Type: Credential disclosure through unsafe endpoint configuration
Risk Level: HighVulnerable Code
python "translate": { "api_url": os.environ.get( 'TRANSLATE_API_URL', 'https://api.siliconflow.cn/v1/chat/completions' ), "api_key": os.environ.get('TRANSLATE_API_KEY', ''), "model": os.environ.get( 'TRANSLATE_MODEL', 'tencent/Hunyuan-MT-7B' ) }, "vision": { "api_url": os.environ.get( 'VISION_API_URL', 'https://api.siliconflow.cn/v1/chat/completions' ), "model": os.environ.get( 'VISION_MODEL', 'Qwen/Qwen2.5-VL-72B-Instruct' ) },python vision_url = config.get('vision', {}).get( 'api_url', 'https://api.siliconflow.cn/v1/chat/completions' ) vision_model = config.get('vision', {}).get( 'model', 'Qwen/Qwen2.5-VL-72B-Instruct' ) try: resp = requests.post( vision_url, headers={ "Authorization": f"Bearer {translate_key}", "Content-Type": "application/json" }, json={ "model": vision_model, "messages": [{"role": "user", "content": [ {"type": "text", "text": prompt}, { "type": "image_url", "image_url": { "url": f"data:image/jpeg;base64,{image_data}" } } ]}], "max_tokens": 200 }, timeout=30 )Technical Analysis
The translation API credential is reused as the authorization credential for the vision service. However,
VISION_API_URLis independently configurable through configuration data or an environment variable. The code does not bind t ...[truncated 2026 chars]- Remediation
View remediation
Remediation Suggestions
- Introduce a dedicated
VISION_API_KEYrather than reusingTRANSLATE_API_KEY. - Do not send an authorization header when vision detection is disabled or when no vision credential is explicitly configured.
- Restrict endpoints to HTTPS and reject URLs using HTTP or other schemes.
- Validate destination hostnames against an explicit allowlist of trusted API providers.
- If the translation and vision endpoints must share a credential, require that both normalized origins match.
- Display the destination hostname and obtain explicit user consent before uploading a video frame.
- Provide a local-only or explicitly disabled subtitle-detection mode.
- Use narrowly scoped provider credentials with spending limits and rotation support.
- Document that transcript text and video frames leave the local system during normal operation.
- Introduce a dedicated
