T09 · Insecure Skill Coding Practices
- Location
scripts/config.py:4- Finding
Bearer API Credentials and Rating Data Transmitted Over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/config.py:4, with affected network operations inscripts/register.py:15-23,scripts/submit.py:22-40, andscripts/query.py:24-32
Vulnerability Type: Plaintext transmission of sensitive credentials and data
Risk Level: HighVulnerable Code
scripts/config.py:4:python ECHO_MARK_API_URL = os.environ.get("ECHO_MARK_API_URL", "http://47.109.154.82:9527")scripts/register.py:15-23:python def register(agent_type): """Register agent with EchoMark cloud service.""" url = f"{ECHO_MARK_API_URL}/api/v1/agents/register" response = requests.post(url, json={"agent_type": agent_type}, timeout=API_TIMEOUT) response.raise_for_status() data = response.json() api_key = data["api_key"]scripts/submit.py:22-40:python def submit_rating(tool_name, accuracy, efficiency, usability, stability, comment=""): """Submit a tool rating to cloud server.""" api_key = load_api_key() url = f"{ECHO_MARK_API_URL}/api/v1/ratings" payload = { "tool_name": tool_name, "accuracy": accuracy, "efficiency": efficiency, "usability": usability, "stability": stability, "comment": comment, } headers = {"Authorization": f"Bearer {api_key}"} response = requests.post(url, json=payload, headers=headers, timeout=API_TIMEOUT) response.raise_for_status() return response.json()scripts/query.py:24-32:python def query_cloud_rating(tool_name): """Query ratings for a specific tool from cloud server.""" api_key = load_api_key() url = f"{ECHO_MARK_API_URL}/api/v1/ratings/{tool_name}" headers = {"Authorization": f"Bearer {api_key}"} response = requests.get(url, headers=headers, timeout=API_TIMEOUT) response.raise_for_status() return response.json()Technical Analysis
...[truncated 2858 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the default endpoint with an HTTPS URL backed by a valid, trusted TLS certificate.
- Reject
http://endpoints whenever registration or authenticated requests are performed. Validate the parsed URL scheme before sending any credential:python from urllib.parse import urlparse parsed = urlparse(ECHO_MARK_API_URL) if parsed.scheme != "https": raise ValueError("EchoMark cloud operations require an HTTPS endpoint") - Retain the default certificate and hostname verification provided by
requests; do not introduceverify=Falseor suppress TLS warnings. - Redirecting HTTP to HTTPS is insufficient for credential-bearing requests because the initial request may already be exposed. Construct authenticated requests directly against HTTPS and disable unsafe downgrade behavior.
- Rotate or revoke all API keys that may previously have been returned or transmitted through the plaintext endpoint.
- Consider restricting environment-based endpoint overrides to HTTPS. If plaintext transport is required solely for local development, require an explicit development-only setting and restrict it to loopback addresses without real credentials.
- Add automated tests asserting that registration, submission, and cloud querying fail closed when configured with a non-HTTPS remote endpoint.
- Update the security documentation to explicitly state that cloud features require TLS and explain how endpoint validation is enforced.
