T09 · Insecure Skill Coding Practices
- Location
wolfram_query.py:11- Finding
API Credential Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
wolfram_query.py, lines 11–15
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: Mediumpython url = "https://www.wolframalpha.com/api/v1/llm-api" params = { "input": query, "appid": app_id }The vulnerable data flow is completed by the request at line 18:
python response = requests.get(url, params=params)Technical Analysis
The script reads
WOLFRAM_APP_IDfrom the process environment and passes it as theappidparameter of an HTTP GET request. Therequestslibrary serializes this parameter into the URL query string.Although HTTPS encrypts the URL while it is in transit, full URLs can still be captured by client-side debugging facilities, HTTP proxies, gateways, observability platforms, exception telemetry, or other systems that record outbound request URLs. Consequently, infrastructure operators or attackers with access to such records may be able to recover the API credential.
The credential is not hardcoded in the repository, and the examined code does not deliberately transmit it to an unrelated endpoint. The exposure risk arises from placing sensitive authentication material in a URL rather than a less commonly logged authorization channel.
Attack Path
- A user configures a valid
WOLFRAM_APP_IDand invokeswolfram_query.py. - The script constructs a GET URL containing the credential as the
appidquery parameter. - A local diagnostic facility, outbound proxy, gateway, monitoring platform, or error-reporting system records the complete request URL.
- An attacker or unauthorized operator gains read access to those records.
- The attacker extracts the
appidvalue and reuses it in requests to the Wolfram|Alpha API. - The stolen credential may remain usable until it is revoked, rotated, or otherwise restricted.
Impact Assessment
Successful exploitation would ...[truncated 536 chars]
- A user configures a valid
- Remediation
View remediation
Remediation Suggestions
- Prefer an API-supported authorization header or POST body so the credential is not included in the URL.
- If the Wolfram|Alpha API requires
appidas a query parameter, treat that exposure as an API constraint and configure clients, proxies, gateways, telemetry systems, and exception handlers to redact theappidparameter. - Disable verbose HTTP request logging in production and verify that monitoring platforms do not retain full query strings.
- Restrict the credential's permissions and usage where supported, apply quota and anomaly monitoring, and rotate it periodically.
- Revoke and replace the credential immediately if URLs containing it may already have been recorded in systems accessible to unauthorized parties.
- Document that request URLs contain sensitive authentication material so operators do not copy them into tickets, chat messages, logs, or public diagnostics.
