T09 · Insecure Skill Coding Practices
- Location
SKILL.md:32- Finding
Environment-Controlled API Host Can Expose Credentials and Analytics Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 32–49
Vulnerability Type: Unvalidated configurable destination for authenticated requests
Risk Level: MediumVulnerable Code:
bash export MILLIMETRIC_KEY=sk_live_... # server key, scope: ingest export MILLIMETRIC_HOST=https://api.millimetric.aiFor local dev against the Worker:
MILLIMETRIC_HOST=http://localhost:8787.bash curl -X POST "$MILLIMETRIC_HOST/v1/track" \ -H "Authorization: Bearer $MILLIMETRIC_KEY" \ -H "Content-Type: application/json" \ -d '{ "event": "signup", "anonymous_id": "u_abc", "user_id": "user_42", "url": "https://yoursite.com/?utm_source=facebook&utm_medium=cpc&fbclid=abc", "properties": { "plan": "free" } }'Technical Analysis
The destination of authenticated API requests is taken directly from the environment-controlled
MILLIMETRIC_HOSTvariable. The documented commands then attachMILLIMETRIC_KEYas a bearer credential without validating the destination's scheme or hostname.If an attacker can influence the process environment, shell profile, CI/CD configuration, task configuration, or agent execution context, they can set
MILLIMETRIC_HOSTto a server under their control. A subsequent legitimate tracking operation will send both the secret ingest key and the event payload to that server.The same pattern is used by the documented track, identify, batch, and forget operations. The identify payload may include direct personal information such as an email address, while other operations may expose user identifiers, URLs, referrers, and behavioral data. Allowing an HTTP localhost endpoint for development also creates a risk of plaintext credential transmission if that option is mistakenly used outside an isolated local environment.
Attack Path
- An attacker gains the ability to influence
MILLIMETRIC_HOST, such as through a poisoned env ...[truncated 1323 chars]
- An attacker gains the ability to influence
- Remediation
View remediation
Remediation Suggestions
- Hard-code
https://api.millimetric.aias the production API origin where configurability is unnecessary. - If a configurable host is required, parse and validate it before attaching credentials:
- Require HTTPS in production.
- Match the normalized hostname and port against an explicit allowlist.
- Reject embedded credentials, unexpected ports, redirects to untrusted origins, and non-HTTPS schemes.
- Do not rely on suffix matching that could accept domains such as
api.millimetric.ai.attacker.example.
- Permit
http://localhost:8787only when an explicit development-mode flag is enabled, and verify that the resolved destination is a loopback address. - Ensure authorization headers are never forwarded across cross-origin redirects. Prefer disabling redirects for authenticated API submissions.
- Treat
MILLIMETRIC_HOSTas security-sensitive configuration and prevent untrusted users, repository content, or request parameters from modifying it. - Use a narrowly scoped, revocable ingest key and rotate it immediately if destination redirection is suspected.
- Hard-code
