T09 · Insecure Skill Coding Practices
- Location
SKILL.md:91- Finding
Apify API Token Exposed in URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 91
Vulnerability Type: Credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
bash curl -X POST "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"keywords": ["#skincaretips", "#skincaretiktok"], "maxItems": 200}'Technical Analysis
The REST fallback places
APIFY_TOKENin the request URL. When the shell expands the variable, the resulting command contains the complete credential in its query string.Although HTTPS protects the request from passive network interception, it does not prevent the URL from being exposed through local process inspection, shell tracing, HTTP access logs, reverse proxies, monitoring systems, debugging output, or other telemetry that records complete URLs. Query parameters are commonly retained more broadly than authorization headers and therefore should not contain reusable credentials.
Attack Path
- A user follows the documented REST fallback with
APIFY_TOKENset. - The shell expands
$APIFY_TOKENinto the URL query parameter. - The complete URL may be captured by process-monitoring facilities, shell tracing, proxy logs, API access logs, or observability tooling.
- An attacker who can read one of those records extracts the reusable token.
- The attacker submits authenticated requests to Apify using the exposed token.
- The attacker can consume resources or access data within the token's existing authorization scope until the token is revoked or expires.
Impact Assessment
Successful exploitation grants the attacker the same Apify API privileges assigned to the compromised token. Depending on its scope, this may permit unauthorized actor runs, consumption of paid platform resources, access to associated run results or datasets, and financial charges against the token owner's account.
The issue does not itself provide loca ...[truncated 80 chars]
- A user follows the documented REST fallback with
- Remediation
View remediation
Remediation Suggestions
Remove the token from the query string and use Apify's supported authorization header:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"keywords":["#skincaretips","#skincaretiktok"],"maxItems":200}'Apply the following additional controls:
- Use a narrowly scoped token with only the permissions required to run the intended actor.
- Prevent commands, headers, and environment variables containing credentials from being printed or included in debug logs.
- Redact authorization data in application, proxy, and observability logs.
- Store the token in an approved secret manager or protected environment variable rather than source-controlled files.
- Rotate any token that may previously have appeared in URL or process logs.
- Review retained telemetry and access logs for historical token exposure and unauthorized use.
