T09 · Insecure Skill Coding Practices
- Location
SKILL.md:22- Finding
API Credential Exposed Through URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 22–24
Vulnerability Type: API credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
yaml mcp_servers: - name: ocean-mcp url: https://api.ocean.io/mcp/?api-token=${OCEAN_API_TOKEN}Technical Analysis
The MCP server configuration places
OCEAN_API_TOKENin the URL query string. Although the value is supplied through an environment variable rather than hardcoded, variable substitution causes the resolved credential to become part of the request URL.URLs may be captured by client diagnostics, HTTP access logs, reverse proxies, network-monitoring systems, exception reports, browser or application history, and observability platforms. HTTPS protects the URL while it is in transit, but it does not prevent either endpoint or authorized intermediaries from recording the resolved URL. Consequently, personnel or systems with access to those records may obtain the token even if they cannot access the original environment variable.
Attack Path
- The runtime reads
OCEAN_API_TOKENfrom the environment. - It substitutes the token into the configured MCP server URL.
- The agent sends a request whose URL contains the credential as
api-token. - A client, proxy, gateway, monitoring service, or error-reporting system records the resolved URL.
- An attacker or unauthorized operator gains access to the retained logs or telemetry.
- The attacker extracts the token and submits requests to the Ocean.io API under the affected account.
Impact Assessment
A recovered token could permit unauthorized use of the Ocean.io functionality and data available to that credential. The attacker may be able to perform company or people searches, retrieve prospecting information, export records, and consume the account's paid credits. The precise scope is limited by the permissions, quotas, expiration policy, and a ...[truncated 160 chars]
- The runtime reads
- Remediation
View remediation
Remediation Suggestions
- Remove the API token from the URL query string.
- Prefer an authorization header, such as
Authorization: Bearer ${OCEAN_API_TOKEN}, or the vendor's supported secret-bearing header. - If the integration framework cannot set authentication headers, use its dedicated secret or credential configuration mechanism rather than embedding secrets in URLs.
- Configure clients, gateways, proxies, and observability systems to redact authorization data and query parameters.
- Avoid logging resolved MCP endpoint URLs or environment-variable values.
- Apply least-privilege scopes, usage quotas, and expiration to the API token where Ocean.io supports them.
- Rotate the current token if the integration has already been used, because the resolved URL may exist in historical logs.
- Review and securely delete or restrict access to historical telemetry that may contain the
api-tokenparameter.
