T09 · Insecure Skill Coding Practices
- Location
SKILL.md:87- Finding
Apify API Token Exposed in a URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 87-91
Vulnerability Type: Credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"keywords": ["#tiktokmademebuyit", "#skincaretiktokshop"], "maxItems": 300}'Technical Analysis
The documented REST fallback places
APIFY_TOKENin the request URL. When the shell expands the environment variable, the resulting token becomes part of the command-line argument passed tocurl.Although HTTPS encrypts the URL while it is transmitted, URLs can still be exposed through local process inspection, HTTP client diagnostics, monitoring infrastructure, proxy logs, error reports, and server-side request or access logs. Systems commonly retain URLs for observability purposes, making query strings unsuitable for credentials.
The project contains only
SKILL.md; no executable implementation is present. The referencedscripts/run_actor.jsfile is absent and could not be reviewed. This finding is therefore limited to the documented REST command.Attack Path
- A user exports a valid
APIFY_TOKENand executes the documented fallback command. - The shell expands
$APIFY_TOKEN, placing its value in the URL supplied as acurlprocess argument. - A local process monitor, privileged local user, diagnostic collector, proxy, or URL-logging service records or observes the full URL.
- An attacker with access to that record extracts the token from the
tokenquery parameter. - The attacker reuses the token against Apify APIs until the credential expires or is revoked.
Exploitation requires an attacker to have access to a system or service that can observe or retain the expanded command or request URL.
Impact Assessment
A disclosed token may permit unauthori ...[truncated 430 chars]
- A user exports a valid
- Remediation
View remediation
Remediation Suggestions
Remove the token from the URL and transmit it through an authorization header:
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": ["#tiktokmademebuyit", "#skincaretiktokshop"], "maxItems": 300}'Apply the following additional controls:
- Use a least-privilege Apify token limited to the capabilities required by this Skill.
- Prevent secrets from being written to command output, debug logs, generated files, or error reports.
- If a
.envfile is supported, exclude it from version control and restrict its filesystem permissions. - Rotate any token that may already have been used in a logged query-string URL.
- Configure proxies and monitoring systems to redact authorization data and sensitive query parameters.
- Add automated secret scanning and documentation linting to detect credentials passed through URLs.
