T09 · Insecure Skill Coding Practices
- Location
SKILL.md:104- Finding
Apify API Token Exposed in URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 104
Vulnerability Type: Credential exposure through a URL query parameter
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": ["we are hiring fintech", "join our team SaaS startup", "software engineer hiring"], "maxItems": 300 }'Technical Analysis
The documented REST fallback expands
APIFY_TOKENdirectly into a URL query parameter. URLs may be recorded by shell or process-monitoring systems, HTTP clients, proxies, gateways, observability platforms, and server access logs. Query strings are commonly retained in logs and telemetry, potentially making the credential accessible to users or systems that should not possess it.Although HTTPS protects the URL while it is transmitted over the network, it does not prevent exposure at the originating host, intermediary application layers, or destination logging systems.
Attack Path
- A user sets
APIFY_TOKENand executes the documentedcurlcommand. - The shell expands
$APIFY_TOKENinto the command-line URL. - A local user with process-inspection access, or a logging and monitoring component, captures the complete URL.
- The observer extracts the token from the
tokenquery parameter. - The observer reuses the token against Apify APIs within the permissions assigned to that credential.
Impact Assessment
A compromised token could allow an attacker to invoke Apify actors, consume account resources, incur usage charges, and access actor runs, datasets, or other Apify resources authorized for the token. The exact scope is limited by the token's configured permissions and the associated account privileges.
No evidence of deliberate credential theft, persistence, hidden payload execution, or other malicious behavior was identified in the audited file.
- A user sets
- Remediation
View remediation
Remediation Suggestions
Pass the API token through an authorization header rather than embedding it in the URL:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "searchTerms": [ "we are hiring fintech", "join our team SaaS startup", "software engineer hiring" ], "maxItems": 300 }'Additional hardening measures:
- Configure the token with the minimum permissions required for actor execution.
- Avoid printing, logging, or persisting authorization headers.
- Redact credentials in command tracing, diagnostics, and observability systems.
- Rotate the existing token if the documented command has already been used in environments where process arguments or complete URLs may have been retained.
- Store the token in a protected environment variable or secret manager rather than a committed
.envfile.
