T09 · Insecure Skill Coding Practices
- Location
SKILL.md:92- Finding
Apify API Token Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 92–105
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchKeywords": "<query>", "maxResults": 50}'bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"Technical Analysis
The documented REST fallback places
APIFY_TOKENdirectly in the request URL. While transmitting a token to Apify is necessary to use the authenticated service, query-string authentication exposes the credential more broadly than required.URLs may be captured in shell history, process-command listings, terminal recordings, debugging output, HTTP client telemetry, proxies, and server-side access logs. TLS protects the request while it is in transit but does not prevent disclosure through these local and endpoint logging channels. Consequently, this pattern violates least-exposure principles for credentials.
The identified requests target the official
api.apify.comdomain, and the audit found no evidence that the token is deliberately sent to an unrelated party. The vulnerability is the insecure credential transport pattern rather than confirmed malicious exfiltration.Attack Path
- A user follows the REST fallback instructions with a valid
APIFY_TOKEN. - The shell expands the token into the command-line URL.
- The authenticated URL is retained or observed through shell history, process inspection, terminal capture, diagnostic output, proxy telemetry, or access logs.
- An attacker with access to one of those sources extracts the token.
- The attacker reuses the token a ...[truncated 673 chars]
- A user follows the REST fallback instructions with a valid
- Remediation
View remediation
Remediation Suggestions
- Replace query-string authentication with Apify's supported authorization-header mechanism so the token is not embedded in the URL.
- Keep
APIFY_TOKENin a protected environment variable or secret manager and never print it or include it in generated output. - Avoid verbose request tracing and redact authorization headers from application, proxy, and monitoring logs.
- Use narrowly scoped tokens where supported, restrict access to only the required actor and datasets, and rotate tokens regularly.
- Revoke and replace any token that may already have appeared in shell history, process captures, or logs.
- Add documentation warning users not to pass credentials in URLs and provide only a header-based REST example.
- If
.envfiles are supported, require restrictive filesystem permissions and ensure they are excluded from version control.
