T09 · Insecure Skill Coding Practices
- Location
SKILL.md:97- Finding
Apify API Token Exposed in URL Query Strings
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 97 and 108
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: MediumThe documented
curlcommands place theAPIFY_TOKENsecret directly in request URLs:bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "keywords": ["[hashtag1]", "[hashtag2]"], "shouldDownloadCovers": false }'bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Technical Analysis
Authentication with Apify is necessary for the Skill's declared TikTok creator-discovery functionality. However, transmitting the API token as a URL query parameter is an insecure credential-handling practice and exceeds the minimum exposure necessary for authentication.
When the shell expands
$APIFY_TOKEN, the resulting secret-bearing URL may be exposed through:- Process command-line inspection while
curlis running. - Shell history, depending on how users invoke or adapt the documented commands.
- HTTP access logs maintained by gateways, reverse proxies, or API infrastructure.
- Network monitoring and observability systems that record complete URLs.
- Debug output, terminal capture, support bundles, or command auditing facilities.
- Browser or tooling history if the URL is reused outside
curl.
HTTPS protects the request in transit from ordinary network interception, but it does not prevent the URL from being recorded at endpoints or by local process-monitoring systems. The token is sent only to the declared
api.apify.comservice, so the audit found no evidence of intentional exfiltration to an unrelated domain.Attack Path
- A user configures a valid
APIFY_TOKENand follows the command documented inSKILL.md. - The shell expands
$APIFY_TOKENinto thecurlcomm ...[truncated 1163 chars]
- Process command-line inspection while
- Remediation
View remediation
Remediation Suggestions
Use an HTTP authorization header instead of placing the token in the URL:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "keywords": ["[hashtag1]", "[hashtag2]"], "shouldDownloadCovers": false }'Retrieve dataset results using the same header-based authentication approach:
bash curl \ "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \ -H "Authorization: Bearer $APIFY_TOKEN"Additional hardening measures:
- Ensure the token is never printed in normal, debug, or error output.
- Store it in a dedicated secret manager where available.
- If a
.envfile is used, exclude it from version control and restrict its filesystem permissions. - Issue a narrowly scoped token with only the permissions required to run the specified actors and retrieve their results.
- Rotate any token that may already have appeared in logs, shell history, or monitoring systems.
- Configure logging and observability systems to redact authorization credentials and legacy
tokenquery parameters. - Remove or sanitize historical records containing secret-bearing URLs.
