T09 · Insecure Skill Coding Practices
- Location
SKILL.md:114- Finding
Apify API Token Exposed in URL Query String
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 114
Vulnerability Type: Credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code:
bash "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \Technical Analysis
The documented REST fallback places
APIFY_TOKENdirectly in the request URL. When the shell expands the environment variable, the resulting secret becomes part of the command argument and URL.URL query strings may be recorded by shell history, process-monitoring tools, terminal session capture, HTTP clients, proxies, observability systems, and server access logs. This gives the credential a broader exposure surface than passing it through a supported authorization header. Quoting the URL prevents shell word splitting but does not prevent token disclosure.
Attack Path
- A user follows the documented REST fallback while
APIFY_TOKENis set. - The shell expands
$APIFY_TOKENinto the URL supplied tocurl. - The expanded URL may be captured by local process inspection, terminal auditing, proxy telemetry, or HTTP access logging.
- An attacker with access to one of those data sources extracts the token.
- The attacker reuses the token to authenticate to Apify APIs within the token's granted permissions.
Impact Assessment
Successful exploitation could permit unauthorized use of the victim's Apify account capabilities within the exposed token's scope. Potential consequences include running actors, consuming paid platform resources, accessing resources available to the token, exhausting quotas, and incurring costs. This finding does not establish privilege beyond the permissions already assigned to the token.
- A user follows the documented REST fallback while
- Remediation
View remediation
Remediation Suggestions
- Use Apify's supported HTTP authorization header rather than the
tokenURL query parameter. - Ensure the token is read from a protected environment variable or secret manager and is never printed or embedded in generated URLs.
- Disable verbose HTTP tracing in environments where authorization headers could be logged, and configure tooling to redact authentication data.
- Use a narrowly scoped token with only the permissions required to run and retrieve results from the intended actor.
- Rotate the token if the documented command has already been used in an environment where command arguments or URLs may have been retained.
- Review shell history, proxy logs, CI logs, terminal recordings, and monitoring data for prior exposure, then remove or securely redact affected records where feasible.
- Use Apify's supported HTTP authorization header rather than the
