T09 · Insecure Skill Coding Practices
- Location
scripts/asr.py:13- Finding
Unrestricted API endpoint overrides can expose credentials and sensitive content
- Content
View full analysis
dict[str, Any]: path = Path(audio_path) with path.open('rb') as f: files = {'file': (path.name, f)} data: dict[str, Any] = {'model': self.model, 'response_format': 'json'} if language and self.model != 'sense-asr-deepthink': data['language'] = language resp = requests.post( self.api_url, headers={'Authorization': f'Bearer {self.api_key}'}, data=data, files=files, timeout=120, ) ``` `scripts/feishu_api.py:10-44`: ```python self.base_url = get_optional('FEISHU_BASE_URL', 'https://open.feishu.cn') self.app_id = get_required('FEISHU_APP_ID') self.app_secret = get_required('FEISHU_APP_SECRET') def tenant_access_token(self) -> str: resp = requests.post( f'{self.base_url}/open-apis/auth/v3/tenant_access_token/internal', headers={'Content-Type': 'application/json; charset=utf-8'}, json={'app_id': self.app_id, 'app_secret': self.app_secret}, timeout=30, ) body = resp.json() if not resp.ok or body.get('code', 0) != 0: raise RuntimeError(f'Feishu tenant token request failed: {body}') token = (body.get('tenant_access_token') or '').strip() if not token: raise RuntimeError(f'Feishu tenant token was empty: {body}') return token def send_text_message(self, receive_id ...[truncated 2919 chars]- Remediation
View remediation
