T09 · Insecure Skill Coding Practices
- Location
SKILL.md:94- Finding
API Token Exposed in Command-Line URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 94
Vulnerability Type: Credential exposure through process arguments and URL handling
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 '{ "searchKeywords": ["best personal finance tools", "personal finance review"], "maxResults": 50, "type": "video" }'Technical Analysis
The documented REST fallback places
APIFY_TOKENin the request URL. When the command is executed, the shell expands the environment variable, causing the secret to appear in curl's command-line arguments. Depending on operating-system configuration and local permissions, command arguments may be exposed through process-inspection facilities, endpoint monitoring, audit records, debugging output, or execution logs.URLs are also more likely than authorization headers to be retained by HTTP infrastructure and observability systems. Although HTTPS protects the request in transit, it does not prevent the token from being disclosed through local process metadata or URL logging at endpoints that can observe the decrypted request.
Attack Path
- A user sets
APIFY_TOKENand runs the documented REST fallback command. - The shell expands
$APIFY_TOKENinto the URL passed to curl. - A local user, monitoring agent, audit subsystem, diagnostic collector, or improperly configured HTTP logger captures the command arguments or request URL.
- The observer extracts the token from the
token=query parameter. - The exposed credential is reused against the Apify API until it is revoked or expires.
This path requires access to relevant local process metadata or logs; the document does not itself transmit the token to an unrelated host.
Impact Assessment
Successful exploitation exposes the privileges assigned to the compro ...[truncated 381 chars]
- A user sets
- Remediation
View remediation
Remediation Suggestions
-
Replace query-string authentication with an Apify-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 '{ "searchKeywords": ["best personal finance tools", "personal finance review"], "maxResults": 50, "type": "video" }' -
Ensure command tracing and verbose HTTP diagnostics are disabled when credentials are used.
-
Redact authorization data from application, proxy, CI/CD, and observability logs.
-
Store the token in a dedicated secret manager where available. If a
.envfile is used, exclude it from version control and restrict its permissions to the owning user. -
Grant the token only the minimum permissions required for actor execution and rotate any token suspected of prior exposure.
-
