T09 · Insecure Skill Coding Practices
- Location
umeng_get_outlier_points.py:50- Finding
Umeng API Credentials Exposed in GET Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
umeng_get_outlier_points.py, lines 50-60
Vulnerability Type: Sensitive information exposure through URL query parameters
Risk Level: MediumVulnerable Code
python # 构建请求 URL base_url = "https://mobile.umeng.com/ht/api/v3/ai/getOutlierPoints" params = { "ak": api_key, "sk": api_security, "appkey": appkey, "ds": ds } try: # 发送 GET 请求 response = requests.get(base_url, params=params, timeout=30)Technical Analysis
The function places both the Umeng API key and API security secret in the query string of a GET request. The
requestslibrary serializesparamsinto a URL resembling:text https://mobile.umeng.com/ht/api/v3/ai/getOutlierPoints?ak=API_KEY&sk=API_SECRET&appkey=APP_KEY&ds=DATEHTTPS encrypts the URL while it is in transit, but it does not prevent the complete URL from being recorded by the client, application monitoring systems, forward or reverse proxies, API gateways, debugging tools, exception telemetry, or destination server access logs. Query strings are commonly treated as loggable request metadata.
Because
skis an authentication secret rather than ordinary request data, its inclusion in the URL creates an unnecessary credential-disclosure risk. The code does not redact the query string or otherwise constrain downstream logging.Attack Path
- A legitimate user invokes
get_umeng_outlier_points. - The function constructs a GET request containing
akandskin its query string. - A proxy, API gateway, monitoring agent, diagnostic system, or destination server records the complete request URL.
- An attacker who has access to those logs searches for requests to
getOutlierPoints. - The attacker extracts the
akandskvalues from the recorded URL. - Subject to the permissions and validity of those credentials, the attacker can submit authenticated requ ...[truncated 726 chars]
- A legitimate user invokes
- Remediation
View remediation
Remediation Suggestions
- Use a POST request body or an authorization header for credentials if the Umeng endpoint supports either mechanism.
- Prefer short-lived, scoped tokens over reusable API secrets where supported.
- If the upstream API strictly requires query-based authentication:
- Disable query-string logging for this endpoint.
- Configure proxies, gateways, tracing systems, and error-reporting tools to redact
akandsk. - Avoid including prepared request URLs in exceptions or debug output.
- Restrict access to network and server logs.
- Use credentials with the minimum required permissions and isolate them per environment.
- Rotate credentials that may already have appeared in URL logs.
- Add automated tests that verify secrets are absent from application logs and exception messages.
