T09 · Insecure Skill Coding Practices
- Location
SKILL.md:90- Finding
Apify API Token Exposed Through Command-Line URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 90
Vulnerability Type: Credential exposure through URL and process arguments
Risk Level: MediumVulnerable Code
bash curl -X POST "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" -H "Content-Type: application/json" -d '{"startUrls": [{"url": "https://www.youtube.com/@competitorhandle"}], "maxResults": 30, "type": "video"}'Technical Analysis
The documented REST fallback places
APIFY_TOKENin the URL query string. When the shell expands this variable, the secret becomes part of thecurlprocess arguments and requested URL.Command-line arguments can be exposed to local process inspection tools, shell tracing, diagnostic records, and monitoring systems. URLs may additionally be retained by proxies, gateways, access logs, error reports, or other observability infrastructure. Query parameters are therefore unsuitable for transmitting long-lived credentials.
Exploitation requires an attacker or logging component capable of observing the command arguments or recorded request URL while the documented command is executed.
Attack Path
- A user sets a valid
APIFY_TOKENand follows the documented REST fallback. - The shell expands
$APIFY_TOKENdirectly into the request URL. - A local user with process-observation access, shell-debugging facility, or URL-logging component captures the expanded URL.
- The attacker extracts the token from the
tokenquery parameter. - The attacker submits requests to Apify using the stolen token.
- The attacker can perform operations and access resources permitted by the token until it expires or is revoked.
Impact Assessment
Successful exploitation compromises the confidentiality of the Apify API token. An attacker may consume paid platform resources, invoke actors, access actor runs or datasets, and perform any other operation authorized by the token. The ...[truncated 214 chars]
- A user sets a valid
- Remediation
View remediation
Remediation Suggestions
-
Do not include API tokens in URLs or query parameters.
-
Supply the token through Apify's supported authorization header, for example:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"startUrls": [{"url": "https://www.youtube.com/@competitorhandle"}], "maxResults": 30, "type": "video"}' -
Use a narrowly scoped token with only the permissions required to invoke the intended actor and retrieve its results.
-
Avoid enabling shell tracing while handling secrets, and prevent command logging from recording authorization headers.
-
Ensure application and proxy configurations redact authorization data from logs.
-
Rotate the token immediately if the original command has been executed in an environment where process arguments or URLs may have been retained.
-
Document secure token storage through environment variables or an approved secrets manager, and prohibit committing tokens to project files.
-
