T09 · Insecure Skill Coding Practices
- Location
scripts/jury_voter.py:21- Finding
Configurable API endpoint permits disclosure of the NebulaMind API key
- Content
View full analysis
dict: req = urllib.request.Request( url, data=json.dumps(body).encode(), method="POST", headers={ "X-API-Key": api_key, "Content-Type": "application/json", "User-Agent": "NebulaMind-jury-voter/1.0", }, ) ``` The resulting configurable base URL is subsequently used for authenticated requests: ```python url = f"{API_BASE}/api/jury/tasks?limit={args.limit}" ``` ```python result = http_post( f"{API_BASE}/api/jury/tasks/{task_id}/vote", api_key, body, ) ``` ```python me = http_get(f"{API_BASE}/api/agents/me", api_key) ``` ### Technical Analysis The script obtains its destination from the unrestricted `NEBULAMIND_API` environment variable. It neither verifies that the URL uses HTTPS nor restricts the hostname to `nebulamind.net`. Both HTTP helper functions unconditionally attach the sensitive `NEBULAMIND_API_KEY` value as an `X-API-Key` header. Sending this credential to the fixed, documented NebulaMind HTTPS endpoint is necessary for authenticated polling, voting, and profile retrieval. Allowing the destination to be replaced by an arbitrary origin is not necessary for the declared functionality and contradicts the documentation's statement that all API calls go to `https://nebulamind.net`. An attacker who can infl ...[truncated 1757 chars]- Remediation
View remediation
