T09 · Insecure Skill Coding Practices
- Location
SKILL.md:88- Finding
API Token Exposed Through URL Query Strings
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 88 and 107
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumComplete Code Snippets
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchTerms": ["at [COMPANY]", "engineer at [STARTUP]", "working at [SECTOR] startup"], "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
The documented REST fallback places
APIFY_TOKENdirectly in the request URL. Although HTTPS encrypts the URL in transit, URL query strings are commonly retained by shell history, process or command telemetry, HTTP client diagnostics, monitoring platforms, reverse proxies, and server access logs.When the shell expands
$APIFY_TOKEN, these systems may record the resulting secret-bearing URL. Anyone with access to such records could recover the token and use it as a bearer credential. The issue affects both documented Apify actor calls.Attack Path
- A user follows either REST fallback example with a valid
APIFY_TOKEN. - The shell expands
$APIFY_TOKENinto the URL query string. - The complete URL is captured by shell history, endpoint telemetry, debugging output, proxy logs, server logs, or copied diagnostic records.
- An attacker or unauthorized operator obtains access to one of those records.
- The attacker extracts the token and submits requests to the Apify API.
- The API accepts requests within the permissions and account scope granted to the compromised token.
Impact Assessment
Successful exploitation could allow unauthorized use of the victim's Apify account within the token's assigned privileges. Depe ...[truncated 358 chars]
- A user follows either REST fallback example with a valid
- Remediation
View remediation
Remediation Suggestions
-
Remove
token=$APIFY_TOKENfrom both request URLs. -
Pass the token through Apify's supported authorization header rather than a query parameter. 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": ["at [COMPANY]", "engineer at [STARTUP]", "working at [SECTOR] startup"], "maxItems": 300}' -
Apply the same header-based authentication pattern to the
twitter-user-scraperrequest. -
Ensure command tracing and HTTP debug logging do not emit authorization headers.
-
Redact credentials from application, proxy, monitoring, and support logs.
-
If
.envis used, exclude it from version control and restrict its filesystem permissions. -
Rotate any token previously used in a query-string URL where logs or telemetry may have retained it.
-
Limit the replacement token to the minimum Apify permissions required for these actor runs.
-
