T09 · Insecure Skill Coding Practices
- Location
SKILL.md:84- Finding
Apify API Token Exposed in URL Query Strings
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 84–99
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: MediumThe REST fallback instructions place
APIFY_TOKENdirectly in multiple request URLs:bash **REST API fallback:** curl -X POST \ "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"queries": ["query1", "query2"], "maxPagesPerQuery": 1}'Save
idasRUN_ID. Poll untilstatus = SUCCEEDED:bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'Fetch results:
bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"Technical Analysis
Authentication with Apify is necessary for the Skill's declared functionality, and the requests target the expected
api.apify.comservice. However, transmitting an API token as a URL query parameter is an insecure credential-handling practice.After shell expansion, the token becomes part of the URL supplied to
curl. URLs are commonly captured by process inspection, HTTP client diagnostics, reverse proxies, gateway access logs, monitoring systems, error reports, and copied terminal output. Although HTTPS protects the URL while it is in transit, it does not prevent disclosure through endpoint or infrastructure logging.The network communication itself does not exceed the minimum privileges required to invoke the hosted scraper. The vulnerability arises from the credential transport mechanism rather than from an unauthorized destination. User-supplied search terms are also intentionally disclosed to Apify as part of the advertised scraping workflow.
Attack Path
- A user exports a valid
APIFY_TOKENand executes the documented REST fallback command. - The shell expands
$APIFY_TOKEN, placing its value ...[truncated 837 chars]
- A user exports a valid
- Remediation
View remediation
Remediation Suggestions
-
Remove
token=$APIFY_TOKENfrom every URL. -
Use Apify's supported authorization-header mechanism instead of query-string authentication, for example:
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": ["query1", "query2"], "maxPagesPerQuery": 1}' -
Apply the same header-based authentication to polling and dataset-download requests.
-
Prefer a credential-aware client or protected configuration mechanism that avoids exposing the token in command-line process arguments.
-
Ensure HTTP debugging, verbose output, and request logging redact authorization data.
-
Use a least-privilege Apify token where supported, and rotate any token suspected of having appeared in process captures, request logs, or diagnostic artifacts.
-
Explicitly inform users that submitted search queries are transmitted to Apify for processing.
-
