T09 · Insecure Skill Coding Practices
- Location
scripts/search.py:109- Finding
API Key Exposure Through Command-Line Input and Request Logging
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does the advertised Baidu Maps search, but its script can expose the Baidu API key and private search terms in logs.
Review before installing. Use only a restricted Baidu Maps API key, prefer BAIDU_AK over passing keys in JSON, avoid sensitive location queries, and remove or redact the stderr request logging before using this in shared terminals, CI, or agent environments.
scripts/search.py:109API Key Exposure Through Command-Line Input and Request Logging
The code clearly matches part of the description: it searches for places/POIs via Baidu Maps and can include richer result fields when scope=2. However, the declared description explicitly says it can also retrieve detailed POI information by UID. No such UID lookup endpoint or function exists in the supplied code; UID only appears as a field in search results. Therefore the description overstates the implemented functionality. There are no obvious undeclared harmful capabilities, but there is a material mismatch because one of the core declared features is absent.
The skill requires environment access to BAIDU_AK and performs network requests, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens sandboxing and reviewability because consumers cannot clearly see that the skill will access secrets and transmit data externally, increasing the chance of unintended secret exposure or overly broad execution privileges.
The natural-language documentation and usage guidance are presented in Chinese, but the file does not indicate that this locale is optional or that users can choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.
The skill is designed to send user-supplied queries and use an API key to an external Baidu Maps endpoint. External transmission is expected for this skill's purpose, but it remains security-relevant because potentially sensitive location queries and secret-backed requests leave the local environment and go to a third party.
## API 文档
- 多维检索:`https://api.map.baidu.com/api_place_pro/v1/region`
The file presents itself entirely as a Baidu Maps search script in Chinese and its documented API usage is tied to Chinese-language behavior, while not offering any user-facing language/locale choice. Under the policy rule, forcing a specific language or locale without opt-in is a natural-language policy concern unless clearly justified as region-specific.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
#!/usr/bin/env python3
"""
Baidu Maps Place Search - 多维检索 API
Docs: https://api.map.baidu.com/place/v3/multidimensional
"""
import sys
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
#!/usr/bin/env python3
"""
Baidu Maps Place Search - 多维检索 API
Docs: https://api.map.baidu.com/place/v3/multidimensional
"""
import sys
The script logs the full parsed request body to stderr, which can include sensitive user queries and the 'ak' API key. In agent, server, or CI environments, stderr is often collected centrally, so this can leak credentials and potentially sensitive location/search data to operators, logs, or downstream systems.