T09 · Insecure Skill Coding Practices
- Location
SKILL.md:86- Finding
Apify API Token Exposed in URL Query Strings
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 86–96
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Technical Analysis
The REST fallback embeds
APIFY_TOKENin URL query strings. This token is intentionally transmitted to the legitimate Apify API, so the behavior is not evidence of malicious exfiltration. Nevertheless, query-string authentication unnecessarily increases credential exposure.When the shell expands
$APIFY_TOKEN, the resulting secret-bearing URL may become visible in process arguments. URLs may also be captured by shell or command telemetry, debugging output, HTTP infrastructure, proxy logs, server access logs, monitoring platforms, and copied diagnostic records. HTTPS protects the request in transit but does not prevent exposure at either endpoint or through local process inspection.The competitor channel identifiers and analysis parameters sent to Apify are necessary for the Skill's declared remote scraping functionality. The insecure placement of the authentication secret, rather than the network request itself, is the confirmed issue.
Attack Path
- A user configures a valid
APIFY_TOKENand follows the documented REST fallback. - The shell expands
$APIFY_TOKENdirectly into each command's URL. - A local process observer, telemetry collector, proxy, server logger, monitoring system, or diagnostic capture records the complete URL.
- An attacker with access to that record extracts the token.
- The attacker submits authenticated requests to Apify using the st ...[truncated 526 chars]
- A user configures a valid
- Remediation
View remediation
Remediation Suggestions
-
Use Apify's supported authorization header rather than a URL query parameter, for example:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'bash curl \ "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \ -H "Authorization: Bearer $APIFY_TOKEN" -
Avoid verbose shell tracing, request logging, or diagnostic output that could reveal authorization headers.
-
Configure log and telemetry systems to redact credentials and authorization metadata.
-
Use a narrowly scoped token with only the permissions required to run the designated actor and retrieve its output.
-
Prefer short-lived credentials where supported, rotate tokens regularly, and immediately revoke any token suspected of exposure.
-
Keep the token in a protected environment variable or secret manager and ensure
.envfiles are excluded from source control with restrictive filesystem permissions.
-
