T09 · Insecure Skill Coding Practices
- Location
scripts/query_macro_information.py:43- Finding
API Credential and Search Data Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/query_macro_information.py:43, 73, 98-106
Vulnerability Type: Plaintext transmission and redundant disclosure of authentication credentials
Risk Level: HighVulnerable Code
python FEEDAX_BASE_URL = "http://221.6.15.90:18011"python url = f"{FEEDAX_BASE_URL}/data-service/v1/news/macro/external/query?apiKey={api_key}"python params = {"apiKey": api_key} headers = { "Content-Type": "application/json", "x-api-key": api_key } try: response = requests.post(url, params=params, headers=headers, json=payload, timeout=60)Technical Analysis
The script sends an API credential and the user's search parameters to a bare IP address over unencrypted HTTP. HTTP provides neither transport confidentiality nor server authentication, allowing an on-path party to read or modify the request and response.
The credential is unnecessarily transmitted through three locations:
- Directly in the constructed URL query string.
- Again through the
paramsargument. - In the
x-api-keyrequest header.
URL-based credentials are especially vulnerable to disclosure because complete URLs may be recorded by proxies, HTTP servers, monitoring systems, exception output, and diagnostic tooling. The API key is required for the declared news-query functionality, but plaintext and redundant transmission exceed the minimum disclosure necessary.
Attack Path
- A user provides a valid FEEDAX API key through the command line, environment, or configuration file.
- The Skill constructs a request to
http://221.6.15.90:18011. - The API key is included in the URL and header while the user’s search keyword is included in the JSON body.
- An attacker controlling or monitoring a network segment, proxy, gateway, or compromised access point captures the unencrypted traffic.
- The attacker extracts the API key and search data or ...[truncated 519 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the plaintext endpoint with an authenticated HTTPS hostname:
python FEEDAX_BASE_URL = "https://api.feedax.cn" - Confirm that TLS certificate verification remains enabled and never set
verify=False. - Send the API key exactly once, preferably through an authorization header:
python headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", } response = requests.post( f"{FEEDAX_BASE_URL}/data-service/v1/news/macro/external/query", headers=headers, json=payload, timeout=60, ) - Remove the key from both the URL string and
params. - Reject endpoint overrides that use non-HTTPS schemes.
- Redact credentials from exception messages, debug output, telemetry, and request logs.
- Rotate any API keys that may already have been transmitted over the plaintext endpoint.
- Replace the plaintext endpoint with an authenticated HTTPS hostname:
