T09 · Insecure Skill Coding Practices
- Location
SKILL.md:106- Finding
Apify API Token Exposed Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 106-128
Vulnerability Type: API credential exposure through URL query strings
Risk Level: MediumThe REST fallback examples place the
APIFY_TOKENcredential directly in 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": ["HR tech SaaS", "HR software launch", "we built HR tool"], "maxItems": 300 }'bash curl -X POST "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"usernames": ["handle1", "handle2"]}'Technical Analysis
Secrets in URL query parameters can be exposed through server access logs, reverse proxies, observability platforms, error reports, debugging output, and process inspection. After shell variable expansion, the token may also appear temporarily in the
curlprocess command-line arguments.HTTPS protects the request URL while it is in transit between TLS endpoints, but it does not prevent the URL from being recorded at the client, TLS termination point, or destination service. Authorization headers are less likely to be logged by default and are therefore the safer authentication mechanism.
The requests target the declared Apify service, and the reviewed file contains no evidence of deliberate credential exfiltration. The issue is an insecure credential-handling practice.
Attack Path
- A user exports a valid
APIFY_TOKENand executes one of the documented REST commands. - The shell expands
$APIFY_TOKENinside the URL. - The resulting URL containing the credential becomes visible to the
curlprocess and may be recorded by Apify, a TLS-terminating proxy, or monitoring and diagnostic infrastructure. - An attacker with access to one of those records or to local process informa ...[truncated 759 chars]
- A user exports a valid
- Remediation
View remediation
Remediation Suggestions
-
Replace query-string authentication with Apify's supported authorization header. 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": ["HR tech SaaS", "HR software launch", "we built HR tool"], "maxItems": 300 }' -
Apply the same change to the
twitter-user-scraperREST example. -
Configure HTTP clients, proxies, and monitoring systems to redact authorization headers and known credential fields.
-
Use narrowly scoped tokens with only the permissions required to run the documented actors.
-
Store the token in a protected environment variable or secret manager rather than source files or command-line literals.
-
Rotate any token suspected of having appeared in logs, process captures, or diagnostic output.
-
Review and restrict access to historical HTTP, proxy, and application logs that may contain token-bearing URLs.
-
