T09 · Insecure Skill Coding Practices
- Location
scripts/codex_ppt_runtime.py:151- Finding
Arbitrary API base URL can receive credentials and private presentation content
- Content
View full analysis
bool: endpoint = base_url.rstrip("/") + "/models" req = urllib.request.Request( endpoint, headers={"Authorization": f"Bearer {api_key}"}, method="GET", ) try: with urllib.request.urlopen(req, timeout=timeout) as resp: ``` ```python # scripts/image_providers/openai_compatible.py:155-162 def _create_client(self) -> Any: if self._client_factory is not None: return self._client_factory() try: from openai import OpenAI except ImportError as exc: raise RuntimeError( f"openai SDK not installed in the active environment. {_dependency_hint('openai')}" ) from exc return OpenAI(api_key=self.api_key, base_url=self.base_url) ``` ```python # scripts/image_providers/openai_compatible.py:167-183 def _create_async_client(self) -> Any: if self._async_client is not None: return self._async_client if self._async_client_factory is not None: self._async_client = self._async_client_factory() return self._async_client try: from openai import AsyncOpenAI except ImportError as exc: try: import openai as _openai # noqa: F401 except ImportError: rais ...[truncated 3771 chars]- Remediation
View remediation
