T09 · Insecure Skill Coding Practices
- Location
references/api-reference.md:33- Finding
API Key Exposure Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
references/api-reference.md:18-19, 28-33, 232-239
Vulnerability Type: API credential exposure through URL query strings
Risk Level: MediumThe API reference documents query-string authentication and provides a command that expands the API key directly into a URL:
markdown ### API Key Authentication Transmission methods: - Request header: `X-API-Key: $TCM_API_KEY` (environment variable recommended) - Query parameter: `?api_key=$TCM_API_KEY` ### API Key Status Query Check whether an API key is valid: ```bash curl -s "https://119.91.226.122/api/api-keys/status?key=$TCM_API_KEY"text The same unsafe status-query example is repeated later in the reference: ```bash curl -s "https://119.91.226.122/api/api-keys/status?key=$TCM_API_KEY"Technical Analysis
Secrets should not be transmitted in URL query parameters. When the shell expands
$TCM_API_KEY, the resulting URL contains the plaintext credential. URLs are routinely captured by shell command histories, process inspection or auditing facilities, HTTP server and reverse-proxy access logs, monitoring systems, debugging output, and URL telemetry.HTTPS encrypts the request in transit but does not prevent disclosure through endpoint logs or local operational records. The documentation already identifies the
X-API-Keyrequest header as a supported alternative, making query-string transmission unnecessary for the Skill's declared functionality and contrary to least-exposure principles.Attack Path
- A user follows the documented API-key status command.
- The shell expands
$TCM_API_KEYinto the request URL. - The complete URL is retained in shell history, process or audit records, API access logs, reverse-proxy logs, or monitoring telemetry.
- An attacker or lower-privileged operator with access to one of those records retrieves the API key.
- The attacker supplies the stolen ...[truncated 954 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove query-parameter authentication from the API reference and server implementation.
-
Remove both examples using
?key=$TCM_API_KEYor?api_key=$TCM_API_KEY. -
Require authentication through the
X-API-Keyheader exclusively. For example:bash curl -s "https://119.91.226.122/api/api-keys/status" \ -H "X-API-Key: $TCM_API_KEY" -
Configure application servers, reverse proxies, observability platforms, and diagnostic tooling to redact the
X-API-Keyheader. -
Prevent credentials from appearing in command traces and debugging output; warn users against enabling shell tracing while running authenticated commands.
-
Review access logs for historical URLs containing
keyorapi_keyparameters, restrict access to those logs, and securely purge retained credential-bearing records where feasible. -
Rotate or revoke API keys that may previously have been transmitted in URLs.
-
Add automated documentation and source checks that reject examples placing secrets in URLs.
-
