T09 · Insecure Skill Coding Practices
- Location
SKILL.md:101- Finding
APIFY_TOKEN Exposed Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:101-105andSKILL.md:128-131
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "searchTerms": ["[TOPIC_KEYWORD_1]", "[TOPIC_KEYWORD_2]"], "maxItems": 300 }'bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"usernames": ["[username1]", "[username2]"]}'Technical Analysis
The documented REST fallback expands the
APIFY_TOKENenvironment variable directly into each request URL. Although HTTPS encrypts the request in transit, it does not protect the token from exposure at endpoints and local observation surfaces where URLs may be recorded.The expanded credential may appear in process command-line arguments, shell tracing output, debugging records, proxy logs, server access logs, monitoring systems, and URL telemetry. Query parameters are commonly retained in logs more broadly than authorization headers. This exceeds the minimum disclosure required for the Skill's functionality because Apify authentication can be supplied through an HTTP authorization header instead.
The outbound transfer of topic keywords and public Twitter/X handles to the declared Apify service is consistent with the Skill's stated functionality. The vulnerability is specifically the unsafe placement of the authentication secret in the URL.
Attack Path
- A user or agent follows one of the documented REST fallback commands.
- The shell expands
$APIFY_TOKENinto the curl command-line URL. - A local user with process-observation access, enabled shell tracing, a diagnostic collector, a proxy, or an HTTP logging component records ...[truncated 909 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the
token=$APIFY_TOKENquery parameter from both URLs. -
Supply the credential using an authorization header supported by Apify, for example:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "searchTerms": ["[TOPIC_KEYWORD_1]", "[TOPIC_KEYWORD_2]"], "maxItems": 300 }'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 '{"usernames": ["[username1]", "[username2]"]}' -
Avoid shell tracing or verbose diagnostic output while handling credentials.
-
Configure clients, proxies, and monitoring systems to redact authorization data.
-
Use a least-privilege Apify token with only the permissions required to run the specified actors.
-
Rotate any token that may already have been captured in process records, traces, or URL logs.
-
Add automated documentation linting to reject credentials placed in URL query strings.
-
