T09 · Insecure Skill Coding Practices
- Location
SKILL.md:28- Finding
Apify API Token Exposed in URL Query Parameters
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent for Bluesky searches through Apify, but it needs Review because it handles an Apify credential in request URLs and does not clearly warn users that search data is sent to Apify.
Install only if you are comfortable sending Bluesky search terms and requested limits to Apify under your Apify account. Use a minimally scoped token if possible, avoid shell tracing or logging full commands, and prefer revising the skill to use Authorization headers instead of token query parameters before use.
SKILL.md:28Apify API Token Exposed in URL Query Parameters
The invocation description says to use the skill when the user asks to 'search Bluesky, find Bluesky posts, monitor Bluesky discussions, or extract Bluesky data.' Several of these phrases are broad and the file does not provide exclusion conditions or narrower trigger constraints, which could cause the skill to activate on loosely related requests.
The skill instructs the agent to send user-provided search terms and retrieve data through a third-party service, but it does not explicitly warn the user that their query will be transmitted to Apify. This creates a privacy and consent risk, especially if users provide sensitive topics, names, or investigative queries expecting only local processing.
The hardcoded use of the Apify API endpoint confirms that data leaves the local environment and is processed by a third party. In this skill context that transmission is expected, but it is still security-relevant because there is no explicit warning, no consent gate, and the token is passed in a way that may be exposed in logs.
RESULT=$(curl -s -X POST "https://api.apify.com/v2/acts/WAJfBnZBYR9mJrk5d/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms": ["SEARCH_TERM"], "maxResults": 50, "sortBy": "relevance"}')
echo "$RESULT" | jq '.'
The hardcoded use of the Apify API endpoint confirms that data leaves the local environment and is processed by a third party. In this skill context that transmission is expected, but it is still security-relevant because there is no explicit warning, no consent gate, and the token is passed in a way that may be exposed in logs.
RESULT=$(curl -s -X POST "https://api.apify.com/v2/acts/WAJfBnZBYR9mJrk5d/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms": ["SEARCH_TERM"], "maxResults": 50, "sortBy": "relevance"}')
echo "$RESULT" | jq '.'
This external endpoint initiates an Apify actor run and therefore transfers user input and account-authenticated activity to a third-party platform. The skill context makes the transmission functionally necessary, but the absence of privacy notice and the use of token-in-URL make it a genuine security weakness rather than a pure false positive.
For larger jobs (async):
RUN_ID=$(curl -s -X POST "https://api.apify.com/v2/acts/WAJfBnZBYR9mJrk5d/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms": ["TERM"], "maxResults": 50}' | jq -r '.data.id')
This external endpoint initiates an Apify actor run and therefore transfers user input and account-authenticated activity to a third-party platform. The skill context makes the transmission functionally necessary, but the absence of privacy notice and the use of token-in-URL make it a genuine security weakness rather than a pure false positive.
For larger jobs (async):
RUN_ID=$(curl -s -X POST "https://api.apify.com/v2/acts/WAJfBnZBYR9mJrk5d/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms": ["TERM"], "maxResults": 50}' | jq -r '.data.id')
Polling the external run status does not itself add much new user-data exposure beyond the original submission, but it continues authenticated communication with Apify using a token in the URL. The main concern is credential handling and undisclosed ongoing interaction with the third-party service.
STATUS=$(curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | jq -r '.data.status')
# Poll every 5s until SUCCEEDED or FAILED
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN" | jq '.'
Fetching dataset items from Apify retrieves externally processed results and continues authenticated third-party data exchange. If the scraped results or the user’s original query are sensitive, this extends the privacy exposure surface, especially with query-string token usage and no explicit user notice.
STATUS=$(curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | jq -r '.data.status')
# Poll every 5s until SUCCEEDED or FAILED
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN" | jq '.'
The log retrieval endpoint continues external authenticated access and may expose operational details in third-party logs. While lower impact than the initial data submission, it still reflects insecure credential handling and undisclosed external interactions within the skill.
## Error Handling
- If APIFY_TOKEN not set: `export APIFY_TOKEN=your_token`
- If run FAILS: `curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID/log?token=$APIFY_TOKEN"`
- Rate limited (429): wait 60s, retry