T09 · Insecure Skill Coding Practices
- Location
SKILL.md:84- Finding
Apify API Token Exposed in URL Query Strings
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 84–91
Vulnerability Type: API 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 '{"searchTerms": "@[BRAND_HANDLE]" (run per platform), "maxItems": 100}'Wait for
SUCCEEDED. Fetch dataset:bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Technical Analysis
The REST fallback places the
APIFY_TOKENcredential directly in URL query strings. Although the requests use HTTPS and communicate with the declared Apify service, HTTPS does not prevent the complete URL from being exposed at endpoints or in operational metadata.After shell expansion, the token may appear in shell history, process or command telemetry, debugging output, reverse-proxy and server access logs, monitoring platforms, or copied command transcripts. Systems with broader access to logs than to secrets can therefore unintentionally disclose the credential.
Authentication to Apify is necessary for the Skill's declared functionality, but transmitting the credential as a query parameter is not the least-exposure method. The token should be carried in Apify's supported authorization header and excluded from logged URLs.
Attack Path
- A user follows the documented REST fallback with
APIFY_TOKENset in the environment. - The shell expands
$APIFY_TOKENinto the command's URL. - The authenticated URL is retained in shell history, command telemetry, process monitoring, debugging output, or HTTP infrastructure logs.
- An attacker or lower-privileged operator obtains access to one of those records.
- The attacker extracts the token from the
tokenquery parameter. - The attacker replays the token against Apify APIs.
...[truncated 585 chars]
- A user follows the documented REST fallback with
- Remediation
View remediation
Remediation Suggestions
-
Remove the
tokenquery parameter from every documented API URL. -
Pass the credential through Apify's supported authorization header:
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 '{"searchTerms":"@[BRAND_HANDLE]","maxItems":100}' curl \ "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \ -H "Authorization: Bearer $APIFY_TOKEN" -
Avoid verbose request logging, shell tracing, or diagnostic output that could print authorization headers.
-
Recommend narrowly scoped tokens with only the permissions required to run the intended Actors and retrieve their results.
-
Rotate any token previously used through the documented query-string commands if those commands may have been retained in logs or command history.
-
Redact authentication parameters and headers from application, proxy, telemetry, and CI/CD logs.
-
