T09 · Insecure Skill Coding Practices
- Location
scripts/keepa.sh:122- Finding
Keepa API Key Exposed in Process Arguments and URL Logging
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a legitimate Keepa API client, but it handles your API key in ways that can expose it, so it should be reviewed before installing.
Install only if you are comfortable sending your Keepa API key and product queries to Keepa. Prefer using an environment variable over a project CONFIG.md file, keep any config file out of repositories and backups, restrict its permissions, avoid running examples with real keys in logged terminals or CI output, and rotate the key if it may have been exposed.
scripts/keepa.sh:122Keepa API Key Exposed in Process Arguments and URL Logging
scripts/keepa.sh:246Improper URL Encoding Allows Keepa API Parameter Injection
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
1. **Keepa API Key** (required):
- Input your Keepa API key
- Get key from: https://keepa.com/#!api
2. **Default marketplace**:
- US (amazon.com)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [[ -z "$KEEPA_API_KEY" ]]; then
print_error "Keepa API key is not configured!"
echo ""
echo "Get API key from: https://keepa.com/#!api"
echo "Then: export KEEPA_API_KEY=your_key"
echo "Or create: ~/.teamclaw-skills/keepa-api/CONFIG.md"
exit 1
The skill clearly instructs use of shell capabilities (test, curl, package installation commands) but does not declare any explicit tool scope such as allowed tools or permissions. This weakens least-privilege controls and can cause the agent to execute shell actions users or platform policy did not expect.
The skill description and operational guidance are written in Chinese, with no indication that users may choose another language or that the locale is intentionally limited. Under the language/locale policy, a skill should not implicitly force a specific language without user opt-in or clear justification.
The skill asks the user for a Keepa API key and specifies storing it in local CONFIG.md files, but does not clearly warn that the credential will be persisted on disk. Users may disclose a secret without understanding its storage location, retention, or exposure risk to other local processes, repositories, or backups.
The skill transmits user-supplied and secret data, including the API key and queried product identifiers, to an external service via curl. External transmission is expected for an API client, but it still creates data exposure risk and should be explicitly scoped and disclosed, especially because the request is performed through a generic shell command.
Execute curl request:
curl -s "https://api.keepa.com/product?key=$API_KEY&domain=$DOMAIN&asin=$ASIN"
The documentation instructs users to place the API key in the URL query string without warning that query parameters are commonly exposed in browser history, reverse-proxy logs, analytics, crash reports, and shared shell history. Although this mirrors the vendor API design, publishing examples this way without any credential-handling warning increases the chance of accidental secret disclosure.
This reference points to an external third-party API endpoint and the surrounding example includes credential transmission to that external service. In this skill context, external transmission is expected, but it is still security-relevant because users may unknowingly send sensitive API keys off-platform and expose them through URL-based authentication.
Keepa API 使用 API Key 进行认证,所有请求都需要在 URL 参数中包含 key 参数。
https://api.keepa.com/product?key=YOUR_API_KEY&domain=1&asin=B08XYZ123
The cURL examples send requests to a third-party service while embedding the API key directly in the command line, which can leak via shell history, process listings, CI logs, and terminal recordings. The issue is amplified because the examples normalize operational use of real credentials without warning users about exposure paths.
The cURL example makes an outbound request to Keepa and includes the API key in the URL, causing both external transmission and potential local credential exposure. In an API client skill this behavior is functionally necessary, but the lack of disclosure and safe-usage guidance makes it a real security concern rather than a mere false positive.
curl -s "https://api.keepa.com/product?key=YOUR_API_KEY&domain=1&asin=B08XYZ123&history=1"
This example performs external transmission to Keepa while embedding an API key in a URL, creating the same risk of disclosure through shell history, logs, and monitoring tools. The batch-query context may also increase operational exposure because users are likely to automate these commands in scripts or CI pipelines where command logging is common.
curl -s "https://api.keepa.com/product?key=YOUR_API_KEY&domain=1&asin=B08XYZ123,B09ABC456,B07DEF789"
The search example transmits credentials to an external service and normalizes placing the secret in a URL. While contacting Keepa is expected for this skill, the documentation omits security context about where the key goes and how it can be captured by local or intermediary logging systems.
curl -s "https://api.keepa.com/search?key=YOUR_API_KEY&domain=1&query=wireless+earbuds"
This best-sellers example also sends an API key to a third-party endpoint via the URL, which is expected behavior for the integration but still security-significant. The danger comes less from maliciousness and more from absent warnings, making accidental credential leakage more likely in user workflows.
curl -s "https://api.keepa.com/bestsellers?key=YOUR_API_KEY&domain=1&categoryId=172282"
The help output advertises batch-asin <ASINs> as a multi-ASIN query command. But in the dispatcher, L384-L386 explicitly state # For batch, just query first ASIN for now and pass only the first comma-separated ASIN to cmd_asin. This directly contradicts the documented behavior of the command.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
./keepa.sh search "wireless earbuds" --category Electronics
Configuration:
Export KEEPA_API_KEY or create ~/.teamclaw-skills/keepa-api/CONFIG.md
Get API Key: https://keepa.com/#!api
EOF
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
keepa_request() {
local endpoint="$1"
local params="$2"
local url="https://api.keepa.com/${endpoint}?key=${KEEPA_API_KEY}${params}"
curl -s --compressed "$url"
}
The API key is embedded in the request URL, which can leak through shell history, process listings in some environments, logs, proxies, monitoring systems, or error reporting. Even over HTTPS, URL-based secrets are more likely to be recorded by infrastructure than headers or request bodies.
The natural-language comments and title in this template are written entirely in Chinese, which imposes a specific language on users without any opt-in or alternative. The policy for this category allows locale constraints only when justified or optional, neither of which is stated here.
文件整体以中文编写,标题也明确为“参考文档”,但未说明这是可选本地化版本或提供语言选择。按照该规则,若技能内容强制单一语言且无用户选择或明确合理化说明,可视为自然语言策略问题。
At L084, the documentation tells users to create ~/.teamclaw-skills/keepa-api/CONFIG.md. However, load_config first checks .teamclaw-skills/keepa-api/CONFIG.md relative to the current directory, and only then checks the home-directory path. This is a documentation-to-code mismatch about where configuration is actually loaded from.