T09 · Insecure Skill Coding Practices
- Location
scripts/vin_info.py:198- Finding
API Credential Exposure Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent VIN lookup skill that sends a user-provided VIN and Juhe API key to the documented Juhe API, with some credential-handling cautions but no evidence of hidden or malicious behavior.
Install only if you are comfortable sending VINs to Juhe for lookup and with Juhe billing or quota use. Prefer setting JUHE_VIN_CAR_DETAIL_KEY as an environment variable or a protected local secret file, avoid passing the key with --key or in GET URLs, and rotate the Juhe key if it was previously exposed in command history or logs.
scripts/vin_info.py:198API Credential Exposure Through Command-Line Arguments
The documentation suggests passing the API key directly on the command line via --key. Command-line arguments are commonly exposed through shell history, process listings, logs, and telemetry, which can leak the credential to other local users or monitoring systems and enable unauthorized API use.
export JUHE_VIN_CAR_DETAIL_KEY=你的 AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_VIN_CAR_DETAIL_KEY=你的 AppKey" > scripts/.env
# 方式三:每次命令行传入
python scripts/vin_info.py --key 你的 AppKey --vin LBV21AF05MSZ88595
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python vin_info.py --key your_api_key --vin LBV21AF05MSZ88595
2. 环境变量:export JUHE_VIN_CAR_DETAIL_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_VIN_CAR_DETAIL_KEY=your_api_key
申请 API Key: https://www.juhe.cn/docs/api/id/862
"""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python vin_info.py --key your_api_key --vin LBV21AF05MSZ88595
2. 环境变量:export JUHE_VIN_CAR_DETAIL_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_VIN_CAR_DETAIL_KEY=your_api_key
申请 API Key: https://www.juhe.cn/docs/api/id/862
"""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python vin_info.py --key your_api_key --vin LBV21AF05MSZ88595
2. 环境变量:export JUHE_VIN_CAR_DETAIL_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_VIN_CAR_DETAIL_KEY=your_api_key
申请 API Key: https://www.juhe.cn/docs/api/id/862
"""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if env_key:
return env_key
env_file = Path(__file__).parent / ".env"
if env_file.exists():
for line in env_file.read_text(encoding="utf-8").splitlines():
line = line.strip()
The skill declares capabilities that imply reading environment variables, local files, and making network requests, but it does not declare an explicit tool scope or allowed-tools boundary. This creates a permission transparency problem: the runtime may permit broader actions than users or reviewers expect, increasing the chance of overreach or misuse if the skill is invoked unexpectedly.
The trigger phrases are broad enough that the skill may activate on general automotive questions like '排量排放' or '查车型配置' without a clear requirement that the user intends a VIN lookup. Unintended activation is risky here because invocation can transmit a VIN or prompt the agent to collect and send identifying vehicle data to a third-party API, potentially incurring cost as well.
The description does not disclose that the user's VIN will be sent to Juhe, a third-party service, for lookup. VINs are sensitive identifiers that can be linked to a specific vehicle and sometimes an owner context, so omitting this notice undermines informed consent and can cause privacy and compliance issues.
The module docstring, usage instructions, and user-facing help/messages are all presented only in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified, which is not present here.