T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_kuaidi.py:110- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a straightforward parcel-tracking skill, but users should avoid passing the API key on the command line and understand shipment details are sent to TianAPI.
Install only if you are comfortable sending parcel tracking numbers, carrier identifiers, and sometimes phone-number suffixes to TianAPI. Use a dedicated, quota-limited TianAPI key where possible, prefer TIANAPI_KUAIDI_KEY over the --key command-line option, protect any scripts/.env file, and rotate the key if it was pasted into shell history or logs.
scripts/fetch_kuaidi.py:110API Key Exposure Through Command-Line Arguments
scripts/fetch_kuaidi.py:70API Key and Shipment Data Transmitted in a URL Query String
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Env Config:
export TIANAPI_KUAIDI_KEY=your_api_key
# 或在脚本同级目录创建 .env 文件: TIANAPI_KUAIDI_KEY=your_api_key
"""
import os
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Env Config:
export TIANAPI_KUAIDI_KEY=your_api_key
# 或在脚本同级目录创建 .env 文件: TIANAPI_KUAIDI_KEY=your_api_key
"""
import os
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Env Config:
export TIANAPI_KUAIDI_KEY=your_api_key
# 或在脚本同级目录创建 .env 文件: TIANAPI_KUAIDI_KEY=your_api_key
"""
import os
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Env Config:
export TIANAPI_KUAIDI_KEY=your_api_key
# 或在脚本同级目录创建 .env 文件: TIANAPI_KUAIDI_KEY=your_api_key
"""
import os
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Env Config:
export TIANAPI_KUAIDI_KEY=your_api_key
# 或在脚本同级目录创建 .env 文件: TIANAPI_KUAIDI_KEY=your_api_key
"""
import os
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Env Config:
export TIANAPI_KUAIDI_KEY=your_api_key
# 或在脚本同级目录创建 .env 文件: TIANAPI_KUAIDI_KEY=your_api_key
"""
import os
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if env_val: return env_val
# 2. .env 文件
env_file = Path(__file__).parent / ".env"
if env_file.exists():
try:
content = env_file.read_text(encoding="utf-8")
The skill invokes a Python script that reads environment variables/files and makes outbound API calls, but it does not declare an explicit tool or permission scope. This weakens the trust boundary for users and hosts because the skill's effective capabilities are broader than what its manifest communicates.
The skill sends tracking numbers and, for some carriers, the last four digits of a phone number to TianAPI, but the description does not clearly warn users that this data is transmitted to a third-party service. Tracking and phone suffix data can be sensitive personal or operational information, so lack of disclosure creates a privacy and consent risk.
The script places the API key, tracking number, and optional phone suffix directly into the URL query string of a GET request. Even over HTTPS, query strings are commonly exposed in logs, browser/history tooling, proxies, monitoring systems, and upstream infrastructure, which increases the chance of credential and shipment-data leakage.
The natural-language instructions and help text are entirely in Chinese, which can impose a fixed language choice on users. The file does not offer an opt-in language selection or explain that the skill is intentionally limited to a Chinese-speaking or region-specific audience.
No suspicious patterns detected.