- Location
- README.md:153
- Finding
- API Credential Exposed in URL Query Strings and Persistent Configuration## Vulnerability Details
**File Location**: `README.md:141-143`, `README.md:153-164`; `SKILL.md:23-25`, `SKILL.md:68-70`, `SKILL.md:84-86`; `references/api-tools-reference.md:6-8`, `references/api-tools-reference.md:17-63`, `references/api-tools-reference.md:105-107`; `references/sorftime-mcp-api.md:5-7`
**Vulnerability Type**: API credential exposure through URL query parameters and plaintext configuration
**Risk Level**: Medium
### Vulnerable Code
`README.md:141-143`:
```bash
curl -X POST "https://mcp.sorftime.com?key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{...}}'
```
`README.md:153-164`:
```json
{
"mcpServers": {
"sorftime": {
"type": "streamableHttp",
"url": "https://mcp.sorftime.com?key=YOUR_API_KEY",
"name": "Sorftime MCP",
"description": "Sorftime cross-border e-commerce platform data service"
}
}
}
```
`SKILL.md:23-25`:
```bash
curl -s -X POST "https://mcp.sorftime.com?key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":N,"method":"tools/call","params":{"name":"TOOL_NAME","arguments":{"amzSite":"US","asin":"ASIN"}}}'
```
`references/sorftime-mcp-api.md:5-7`:
```bash
curl -s -X POST "https://mcp.sorftime.com?key={API_KEY}" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":N,"method":"tools/call","params":{"name":"TOOL_NAME","arguments":{...}}}'
```
### Technical Analysis
The documented authentication scheme places the Sorftime API key in the URL query string. Although HTTPS encrypts the request while it is in transit, URLs may still be recorded outside the encrypted transport channel in shell history, process command lines, debugging output, application logs, reverse-proxy logs, monitoring systems, crash reports, and support diagnostics.
The README also instructs users to persist the complete credenti
...[truncated 2110 chars]
- Remediation
- ## Remediation Suggestions
1. **Use header-based authentication**
- Prefer a standard authorization header such as `Authorization: Bearer ...`.
- If Sorftime supports a dedicated API-key header, use that mechanism instead of a query parameter.
2. **Load credentials at runtime**
- Retrieve the API key from a protected environment variable or secret manager.
- Do not place the literal key in documentation examples, shell commands, or project configuration files.
```bash
curl -s -X POST "https://mcp.sorftime.com" \
-H "Authorization: Bearer ${SORFTIME_API_KEY}" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{...}}'
```
3. **Protect local configuration**
- Add `.mcp.json` and any credential-bearing local override files to `.gitignore`.
- Provide a sanitized `.mcp.json.example` containing placeholders only.
- Restrict credential-file permissions to the owning user, for example with mode `0600`.
4. **Reduce command-line exposure**
- Avoid passing secrets as literal command-line arguments.
- Where query authentication is unavoidable, construct the authenticated request inside a protected runtime wrapper and prevent command tracing and URL logging.
5. **Introduce operational safeguards**
- Document key rotation and revocation procedures.
- Redact query parameters in proxy, application, diagnostic, and monitoring logs.
- Use scoped, least-privilege credentials and apply quota or anomaly alerts.
- Rotate any real key previously stored in source control, shell history, logs, backups, or shared configuration.