T09 · Insecure Skill Coding Practices
- Location
SKILL.md:91- Finding
API Token Exposed in URL Query String
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 91
Vulnerability Type: Sensitive credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
bash curl -X POST "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"queries": ["[KEYWORD_1]", "[KEYWORD_2]"], "maxPagesPerQuery": 1}'Technical Analysis
The documented REST fallback places
APIFY_TOKENdirectly in the request URL. Although HTTPS protects the request while it is in transit to the legitimate Apify endpoint, URL query strings are commonly captured by shell tracing, command history, HTTP client diagnostics, proxies, access logs, monitoring systems, and error-reporting platforms.Network access to Apify and authentication with an Apify token are necessary for the Skill's declared Google SERP analysis. However, exposing the credential in a query string is not the minimum safe authentication mechanism and unnecessarily expands the number of systems that may retain it.
No evidence indicates intentional credential exfiltration: the destination is the declared service, and the audit found no malicious instruction hijacking, persistence, obfuscation, or remote payload execution.
Attack Path
- A user follows the documented REST fallback command with
APIFY_TOKENset. - The shell expands
$APIFY_TOKENinto the complete request URL. - The resulting URL may be retained by shell tracing, process instrumentation, proxy logs, endpoint monitoring, or HTTP diagnostics.
- An attacker or unauthorized operator with access to one of those records obtains the token.
- The attacker reuses the token against Apify APIs within the permissions assigned to it.
Impact Assessment
A leaked token may permit unauthorized use of the victim's Apify account resources within that token's scope. Potential consequences include consuming paid execution quota, starting actor runs, ...[truncated 291 chars]
- A user follows the documented REST fallback command with
- Remediation
View remediation
Remediation Suggestions
-
Use Apify's supported authorization-header mechanism rather than a URL query parameter, 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":["[KEYWORD_1]","[KEYWORD_2]"],"maxPagesPerQuery":1}' -
Verify the exact authentication-header syntax against current Apify documentation before publishing the replacement command.
-
Use a narrowly scoped token granting only the permissions required to run the designated actor and read its results.
-
Avoid verbose shell tracing or HTTP debugging when credentials are present, and ensure logs redact authorization values.
-
If the token is loaded from
.env, exclude that file from version control and restrict its filesystem permissions. -
Rotate any token that may already have appeared in URL, proxy, monitoring, or diagnostic logs.
-
Update the documentation to warn users not to paste tokens directly into commands or commit them to project files.
-
