T09 · Insecure Skill Coding Practices
- Location
SKILL.md:97- Finding
Apify API Token Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:97-100andSKILL.md:119
Vulnerability Type: API credential exposure through URL query parameters
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": ["#skincarereviews", "#skincarehaul"], "maxItems": 200 }'bash curl -X POST "https://api.apify.com/v2/acts/apidojo~tiktok-profile-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"profiles": ["https://www.tiktok.com/@handle1"]}'Technical Analysis
The documented REST fallback places
APIFY_TOKENin the request URL. When the shell expands the environment variable, the credential becomes part of thecurlprocess command line. It may consequently be exposed through process inspection, shell history, terminal or command auditing, proxy and access logs, monitoring systems, error telemetry, and other systems that record URLs.HTTPS protects the request while it is in transit but does not prevent credential disclosure at the local endpoint or through URL logging by trusted infrastructure.
Attack Path
- A user follows one of the documented REST API examples with
APIFY_TOKENset. - The shell expands
$APIFY_TOKENinto the URL passed tocurl. - A local user or monitoring component captures the process command line or records the complete URL.
- An attacker obtains the exposed token from that record.
- The attacker reuses the token against Apify APIs within the permissions assigned to it.
Impact Assessment
Successful exploitation grants access limited to the compromised token's Apify permissions. Depending on those permissions, an attacker could execute actors using the victim's account resources, consume paid platform capacity, inspect accessible actor-run metadata or datasets, and cau ...[truncated 104 chars]
- A user follows one of the documented REST API examples with
- Remediation
View remediation
Remediation Suggestions
Remove the token from both query-string examples and transmit it through an 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": ["#skincarereviews", "#skincarehaul"], "maxItems": 200 }'Apply the same pattern to the profile-scraper request. In addition:
- Use a restricted token granting only the permissions required by this workflow.
- Store the token in a protected secret manager or environment variable rather than source files.
- Avoid verbose command logging that could capture authorization headers.
- Rotate the token if the query-string examples have been used in environments where URLs or process command lines are retained.
- Review and sanitize proxy, access, shell-history, and telemetry records that may contain previously exposed tokens.
