T09 · Insecure Skill Coding Practices
- Location
SKILL.md:92- Finding
Apify API Token Exposed in Request URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 92
Vulnerability Type: API credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
bash curl -X POST "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{ "queries": ["email marketing tools", "best email marketing tools", "how to email marketing"], "maxPagesPerQuery": 3, "countryCode": "US", "includePeopleAlsoAsk": true }'Technical Analysis
The documented REST fallback places
APIFY_TOKENin a URL query parameter. Once the shell expands the environment variable, the secret becomes part of the command-line URL. URLs can be captured by shell history, process inspection, command auditing, client diagnostics, proxy telemetry, monitoring platforms, and server access logs.The receiving endpoint is the expected official Apify API, and sending search terms to that service is necessary for the Skill's declared remote scraping function. Therefore, this finding does not establish intentional exfiltration. Nevertheless, placing authentication credentials in a URL unnecessarily increases their exposure compared with transmitting them in an authorization header.
Attack Path
- A user sets
APIFY_TOKENand executes the documented REST fallback. - The shell expands the token into the command-line URL.
- A local process monitor, shell-history mechanism, audit system, proxy, diagnostics system, or remote access log records the URL.
- An attacker with access to one of those records extracts the token.
- The attacker uses the exposed token to make requests to Apify under the victim's account and within the token's assigned permissions.
Impact Assessment
A recovered token may permit unauthorized consumption of Apify resources, access to token-authorized account data or actor results, and generation of usag ...[truncated 224 chars]
- A user sets
- Remediation
View remediation
Remediation Suggestions
Remove the token from the URL and provide it through an authorization header:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "queries": ["email marketing tools", "best email marketing tools", "how to email marketing"], "maxPagesPerQuery": 3, "countryCode": "US", "includePeopleAlsoAsk": true }'Additionally:
- Ensure
.envfiles are excluded from version control and readable only by the owning user. - Avoid verbose HTTP diagnostics that may record authorization material.
- Redact credentials from application, proxy, and audit logs.
- Use a narrowly scoped token where Apify supports token scoping.
- Rotate any token suspected of having appeared in retained URLs or logs.
- Warn users not to submit confidential search terms because those terms are intentionally transmitted to the external Apify service.
- Ensure
