T09 · Insecure Skill Coding Practices
- Location
SKILL.md:110- Finding
API Token Exposed Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 110–119
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumThe REST API fallback embeds the
APIFY_TOKENenvironment variable directly into request URLs:bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchTerms": ["[TEAM_NAME]", "#[TeamHashtag]", "[TEAM_NAME] game"], "maxItems": 100}'After the Actor run succeeds, the dataset retrieval command repeats the same unsafe pattern:
bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Technical Analysis
The Skill legitimately requires network access to Apify, and transmitting an authentication token to that service is necessary for its declared Twitter-sentiment functionality. The defect is the token's placement in the URL query string rather than in an authorization header.
HTTPS encrypts the request in transit, but it does not prevent the expanded URL from being exposed at endpoints or intermediary operational layers. Depending on the environment, the token may appear in:
- Process arguments visible to local process-inspection tools.
- Shell tracing and command-execution logs.
- HTTP client diagnostics and error reports.
- Reverse-proxy, gateway, monitoring, or server access logs.
- Command history if users substitute a literal token instead of retaining the variable reference.
Thus, the behavior exceeds the minimum necessary exposure of the credential even though the destination itself is relevant to the Skill.
Attack Path
- A user follows the documented REST fallback while
APIFY_TOKENcontains a valid credential. - The shell expands
$APIFY_TOKENinto thecurlrequest URL. - A local process observer, diagnostic system, proxy, gateway, or server-side logger records the complete ...[truncated 1058 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove
token=$APIFY_TOKENfrom every URL. -
Use Apify's supported HTTP authorization header, subject to verification against its current API documentation. 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": ["[TEAM_NAME]", "#[TeamHashtag]", "[TEAM_NAME] game"], "maxItems": 100}'bash curl \ "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \ -H "Authorization: Bearer $APIFY_TOKEN" -
Ensure command tracing and verbose HTTP logging are disabled when credentials are used.
-
Redact authorization headers and tokens from application, proxy, and monitoring logs.
-
Store the token in a managed secret store or protected environment variable rather than source files or command history.
-
Use a least-privilege Apify token restricted to only the resources required by this Skill, if supported.
-
Rotate any token that may already have been captured in URLs or operational logs.
-
