T09 · Insecure Skill Coding Practices
- Location
SKILL.md:116- Finding
Apify API Token Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 116–117 and 144–145
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "searchTerms": ["[TOPIC_KEYWORD]"], "maxItems": 200 }'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": ["[username1]", "[username2]"] }'Technical Analysis
The Skill instructs users or agents to interpolate
APIFY_TOKENdirectly into HTTPS URL query parameters. The credential is sent to the declared officialapi.apify.comservice and is required to authenticate the scraping workflow; therefore, this is not evidence of malicious exfiltration or transmission to an undeclared destination.Nevertheless, secrets in URLs are more likely to be retained outside the encrypted request channel. The expanded URL may appear in process arguments, shell diagnostics, HTTP access logs, reverse-proxy logs, observability platforms, and API monitoring records. Although interactive shell history will normally preserve the literal variable reference in this exact example rather than its expanded value, wrappers or copied expanded commands may also persist the token.
The behavior therefore constitutes insecure credential handling rather than excessive network privilege. No unrelated environment variables or local files are transmitted.
Attack Path
- A user or agent runs one of the documented
curlcommands withAPIFY_TOKENdefined. - The shell expands the variable and places the resulting URL, including the token, in the
curlprocess arguments. - A local user with sufficient process-inspection access, or an op ...[truncated 723 chars]
- A user or agent runs one of the documented
- Remediation
View remediation
Remediation Suggestions
- Replace query-string authentication with Apify's supported authorization-header mechanism.
- Avoid placing the expanded token directly in command-line arguments where feasible.
- Store the token in a protected secret manager or a
.envfile restricted to the owning user; never commit it to source control. - Use a dedicated, least-privilege Apify token for this Skill and rotate it periodically.
- Configure clients, proxies, CI systems, and observability tools to redact authorization credentials.
- Revoke and rotate the token immediately if URLs containing it may have been logged.
- Add explicit documentation warning users not to print, persist, or share expanded authenticated URLs.
