T09 · Insecure Skill Coding Practices
- Location
genie_client.py:39- Finding
API keys, session keys, and message data are transmitted over plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
genie_client.py:39-58; supporting deployment configuration atSKILL.md:39,DEPLOY.md:103-124, andSPEC.md:361
Vulnerability Type: Cleartext transmission of credentials and private message content
Risk Level: HighVulnerable Code
python def __init__(self, server_url: str = None, agent_id: str = None, api_key: str = None): self.server_url = server_url or DEFAULT_SERVER self.agent_id = agent_id or os.environ.get("ALIGENIE_AGENT_ID", "") self.api_key = api_key or os.environ.get("ALIGENIE_API_KEY", "") self._session = requests.Session() self._session.headers["Content-Type"] = "application/json" if self.api_key: self._session.headers["X-Api-Key"] = self.api_key def _url(self, path: str) -> str: return f"{self.server_url.rstrip('/')}{path}" def register(self, session_key: str = "", timeout: int = 30) -> dict: """Register this agent with the server.""" r = self._session.post( self._url("/genie/register"), json={"agentId": self.agent_id, "sessionKey": session_key, "timeout": str(timeout)}, timeout=10, ) r.raise_for_status() return r.json()The documented configuration explicitly uses plaintext HTTP:
python client = GenieClient( server_url="http://101.43.110.225:58472", agent_id="lobster", api_key="ak_xxx" )text | TCP | 58472 | 0.0.0.0/0 | HTTP API |bash curl -H "X-Api-Key: ak_xxx" http://101.43.110.225:58472/api/v1/devicesTechnical Analysis
The client places the API key in the
X-Api-Keyheader and transmits the registration session key in a JSON body. The same session is also used to poll voice requests and submit replies. The documented remote endpoint useshttp://and is exposed to0.0.0.0/0.Header-based authentication provides no transport confidentiality or server authenticity. W ...[truncated 1414 chars]
- Remediation
View remediation
Remediation Suggestions
- Require HTTPS for every non-loopback server URL and reject plaintext HTTP by default.
- Place the Java backend behind a TLS reverse proxy using a valid, automatically renewed certificate.
- Redirecting HTTP is insufficient for credential-bearing requests; disable or reject plaintext API traffic.
- Restrict port 58472 so only the reverse proxy or explicitly authorized source networks can reach it.
- Use narrowly scoped, expiring API keys instead of broadly privileged credentials.
- Rotate all API keys and session keys that may previously have crossed an untrusted network.
- Consider certificate pinning or mutual TLS where the operating environment supports it.
- Avoid exposing management endpoints on the same unrestricted public listener as webhook traffic.
