T09 · Insecure Skill Coding Practices
- Location
SKILL.md:108- Finding
API Token Exposed in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 108 and 114
Vulnerability Type: API 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": ["[PRODUCT] launch", "[PRODUCT] just launched", "new [PRODUCT]", "[PRODUCT] release"], "maxItems": 100}'bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Technical Analysis
The documented REST fallback passes
APIFY_TOKENin URL query parameters. Although HTTPS protects the URL in transit between correctly configured endpoints, placing credentials in URLs increases their exposure because complete URLs may be captured by shell history, process inspection, HTTP client diagnostics, proxy or access logs, monitoring platforms, and copied error reports.Reusing the token in both the actor-start request and dataset-retrieval request expands the number of locations in which the credential may be recorded. The external communication with Apify is necessary for the Skill's declared Twitter-scraping functionality, but exposing its authentication token in URLs is not necessary and violates secure secret-handling and least-exposure principles.
Attack Path
- A user follows the documented REST fallback with a valid
APIFY_TOKEN. - The shell expands
$APIFY_TOKENinto each request URL. - The resulting URL is exposed through a local process listing, command tracing, client diagnostics, proxy/access logging, telemetry, or copied troubleshooting output.
- An attacker with access to one of those records extracts the token.
- The attacker submits authenticated Apify requests using the recovered token.
- The attacker can perform actions allowed by that token until it is revoked, rotated, or otherwise expires.
...[truncated 567 chars]
- A user follows the documented REST fallback with a valid
- Remediation
View remediation
Remediation Suggestions
- Pass
APIFY_TOKENthrough Apify's supported authorization header rather than a URL query parameter. - Ensure commands, request diagnostics, and error reports redact authorization headers and other secret-bearing values.
- Disable shell tracing when executing commands that access credentials, and avoid printing expanded commands.
- Use a narrowly scoped token with only the permissions needed to run the designated actor and retrieve its results.
- Store the token in an approved secret manager or protected environment variable; do not commit it to project files.
- Review proxy, access, telemetry, and shell-history records for previously exposed URLs.
- Revoke and rotate any token suspected of having appeared in logs, process captures, or shared troubleshooting output.
- Document a single secure authentication pattern and use it consistently for both actor execution and dataset retrieval.
- Pass
