T09 · Insecure Skill Coding Practices
- Location
SKILL.md:98- Finding
Apify API Token Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 98-107
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": ["launching soon [SECTOR]", "beta waitlist [SECTOR]", "building [SECTOR] product", "#buildinpublic [SECTOR]", "soft launch [SECTOR]"], "maxItems": 100}'bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Technical Analysis
The documented REST fallback interpolates the
APIFY_TOKENcredential into the URL query string for both actor execution and dataset retrieval. Although the destination is the expected Apify API domain and the network access is necessary for the Skill's declared functionality, placing credentials in URLs exceeds the minimum safe exposure required for authentication.Expanded URLs can be captured by shell history, process inspection, proxy and gateway logs, observability platforms, HTTP client diagnostics, and error reports. TLS protects the request in transit but does not prevent credential disclosure through these endpoint and infrastructure records. There is no evidence that the Skill intentionally sends the token to an attacker-controlled service.
Attack Path
- A user sets
APIFY_TOKENand executes one of the documented REST fallback commands. - The shell expands
$APIFY_TOKENinto the command's URL. - The credential-bearing URL is retained in shell history, process telemetry, proxy logs, monitoring data, or diagnostic output.
- An attacker or unauthorized operator with access to one of those records extracts the token.
- The attacker reuses the token against the Apify API within the permissions and account limits assigned to that credential.
Impact Assessment
A recovere ...[truncated 429 chars]
- A user sets
- Remediation
View remediation
Remediation Suggestions
-
Remove
token=$APIFY_TOKENfrom all URLs and send the credential through an authorization header supported by Apify: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": ["launching soon [SECTOR]", "beta waitlist [SECTOR]", "building [SECTOR] product", "#buildinpublic [SECTOR]", "soft launch [SECTOR]"], "maxItems": 100}'bash curl \ "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \ -H "Authorization: Bearer $APIFY_TOKEN" -
Ensure application, proxy, and monitoring logs redact authorization values and other credentials.
-
Avoid command tracing or verbose diagnostics while invoking authenticated requests.
-
Store the token in a protected secret manager or environment variable rather than plaintext configuration.
-
Grant the token only the minimum Apify permissions required for actor execution and dataset retrieval.
-
Rotate any token that may previously have appeared in command history, logs, telemetry, or diagnostic records.
-
