T09 · Insecure Skill Coding Practices
- Location
SKILL.md:93- Finding
Apify API Token Exposed in Request URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 93–98
Vulnerability Type: API credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "usernames": ["[handle1]", "[handle2]"], "maxItems": 30 }'Technical Analysis
The documented REST fallback expands
APIFY_TOKENdirectly into the request URL. Although HTTPS protects the URL while it is in transit, the expanded credential may remain visible in thecurlprocess arguments and may be recorded by shell diagnostics, command auditing, HTTP client traces, proxies, monitoring systems, or other infrastructure that logs complete URLs.Consequently, users who follow the Skill instructions may unintentionally disclose a reusable authentication credential. The issue is limited to the token's configured Apify privileges; the audit did not establish that it grants broader system access.
Attack Path
- A user exports a valid
APIFY_TOKENand runs the documented REST fallback command. - The shell expands
$APIFY_TOKENinto the URL passed tocurl. - An attacker with access to local process information or a system that captures complete request URLs obtains the expanded token.
- The attacker submits authenticated requests to Apify using the stolen token.
- The attacker can perform actions permitted by that token until it is revoked, rotated, or expires.
Impact Assessment
Successful exploitation can permit unauthorized use of the victim's Apify account within the token's assigned privileges. Potential effects include running actors, consuming paid platform resources, accessing API-visible data available to the token, and causing financial or operational impact. The exact scope depends on the permissions and account resources associat ...[truncated 26 chars]
- A user exports a valid
- Remediation
View remediation
Remediation Suggestions
-
Use Apify's supported HTTP authorization header instead of placing the token in the query string. For example:
bash curl -X POST \ "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs" \ -H "Authorization: Bearer $APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "usernames": ["[handle1]", "[handle2]"], "maxItems": 30 }' -
Confirm the precise authorization-header syntax against the current Apify API documentation before publishing the revised command.
-
Ensure command output, debug traces, and HTTP headers are not logged when they may contain credentials.
-
Keep
.envfiles outside version control, apply restrictive filesystem permissions, and provide a safe.env.examplecontaining placeholders only. -
Grant the token only the minimum privileges needed for actor execution and dataset retrieval.
-
Rotate the token immediately if the vulnerable command has been executed in an environment where process arguments or URLs may have been retained.
-
