T09 · Insecure Skill Coding Practices
- Location
SKILL.md:96- Finding
Apify API Token Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 96–101, 116–121, and 136–141
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"usernames": ["[handle1]", "[handle2]"]}'bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tiktok-profile-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"usernames": ["[handle1]", "[handle2]"]}'bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"usernames": ["[handle1]", "[handle2]"], "maxItems": 12}'Technical Analysis
All three documented REST fallback commands transmit
APIFY_TOKENas a URL query parameter. URLs are commonly recorded by HTTP servers, reverse proxies, observability platforms, command-line process monitoring, debugging tools, and error-reporting systems. Although HTTPS protects the URL while it is in transit, it does not prevent either endpoint or local process metadata from recording it.When the shell expands
$APIFY_TOKEN, the resulting token may also be visible in thecurlprocess arguments to other sufficiently privileged local users or monitoring agents while the request is running. Placing a reusable credential in a URL therefore increases its exposure beyond the intended authentication boundary.Attack Path
- A user sets a valid
APIFY_TOKENand follows one of the documented REST fallback commands. - The shell substitutes the environment variable with the actual token in the URL passed to
curl. - The expanded URL is exposed through process telemetry or retained in server, proxy, monitoring, debugging, or diagnostic logs.
- An ...[truncated 802 chars]
- A user sets a valid
- Remediation
View remediation
Remediation Suggestions
Remove credentials from all URL query strings and send the token through Apify's supported authorization header instead:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"usernames": ["[handle1]", "[handle2]"]}'Apply the same pattern to the TikTok and Instagram examples.
Additional hardening measures:
- Use a least-privilege Apify token with access restricted to the operations required by this skill.
- Keep the token in an environment variable or dedicated secret manager; do not store it in source files, command output, generated reports, or URLs.
- Configure logging and observability systems to redact
Authorizationheaders and known credential fields. - Avoid verbose HTTP debugging when authenticated requests are executed.
- Rotate any token previously used with these query-string examples if URLs may have been logged or captured.
- Document token revocation and incident-response procedures for suspected exposure.
