T09 · Insecure Skill Coding Practices
- Location
gsdata_adapter.py:24- Finding
Credential-Derived Authentication Material Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
gsdata_adapter.py:24,gsdata_adapter.py:203-213,gsdata_adapter.py:408-410, andgsdata_adapter.py:453-460
Vulnerability Type: Plaintext transmission of sensitive authentication material
Risk Level: HighVulnerable Code
python DEFAULT_BASE_URL = "http://databus.gsdata.cn:8888/api/service"python def make_sign(params: Dict[str, Any], app_secret: str) -> str: # GSData signature: md5(app_secret + "_" + sorted(kv concat) + "_" + app_secret) sorted_items = sorted(params.items(), key=lambda x: x[0]) concat = "".join(f"{k}{v}" for k, v in sorted_items) raw = f"{app_secret}_{concat}_{app_secret}" return hashlib.md5(raw.encode("utf-8")).hexdigest() def make_access_token(app_key: str, sign: str, router: str) -> str: return base64.b64encode(f"{app_key}:{sign}:{router}".encode("utf-8")).decode( "utf-8" )python sign = make_sign(params, self.app_secret) token = make_access_token(self.app_key, sign, route) headers = {"access-token": token}python def _request( self, method: str, params: Dict[str, Any], headers: Dict[str, str] ) -> requests.Response: # GSData gateway commonly accepts params in query/body against one base URL. if method == "POST": return requests.post( self.base_url, data=params, headers=headers, timeout=30 ) return requests.get(self.base_url, params=params, headers=headers, timeout=30)Technical Analysis
The adapter defaults to an unencrypted
http://GSData endpoint. Every non-dry-run request includes anaccess-tokencontaining the application key, a secret-derived MD5 signature, and the selected API route. Request parameters are also transmitted in either the URL query string or POST body.Base64 is only reversible encoding and provides no confidentiality. Although the application secret itself is n ...[truncated 1665 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the default endpoint with an official HTTPS endpoint.
- Reject any base URL whose scheme is not
https. - Retain TLS certificate verification and do not introduce
verify=False. - Consider pinning or allowlisting the expected GSData hostname.
- Fail closed if HTTPS is unavailable rather than falling back to plaintext HTTP.
- If the GSData protocol supports it, migrate from MD5-based signing to a modern construction such as HMAC-SHA-256.
- Confirm that the server enforces short validity periods, nonces, timestamps, and replay protection for signed requests.
- Avoid placing sensitive query data in URL parameters where the API permits use of protected POST bodies.
