T09 · Insecure Skill Coding Practices
- Location
scripts/bankcard_lookup.py:26- Finding
Full Bank Card Numbers and API Credentials Transmitted over Plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it claims, but it sends full bank card numbers and the API key over plaintext HTTP, which is unsafe for financial data.
Review carefully before installing. Do not use this with real card numbers or production Juhe keys unless the implementation is changed to HTTPS, avoids putting secrets in URLs or command-line arguments, and clearly tells users that card numbers are sent to Juhe. Rotate any API key already used with the current HTTP implementation.
scripts/bankcard_lookup.py:26Full Bank Card Numbers and API Credentials Transmitted over Plaintext HTTP
scripts/bankcard_lookup.py:200API Key Exposure through Command-Line Arguments and Weakly Protected Local Configuration
The skill instructs sending full bank card numbers to a third-party API but does not provide a user-facing privacy warning or consent step. Bank card numbers are highly sensitive financial data, and transmitting them to an external service without explicit disclosure can create privacy, compliance, and data-handling risks if the provider logs, retains, or misuses the data.
The documentation recommends placing the API key into scripts/.env, which can lead to credential leakage if the file is committed, packaged, or made readable by other local users. Because the skill also handles sensitive financial queries, compromise of the API key could enable unauthorized API use, billing abuse, and uncontrolled third-party requests under the owner's account.
export JUHE_BANKCARDCODE_KEY=你的AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_BANKCARDCODE_KEY=你的AppKey" > scripts/.env
# 方式三:每次命令行传入
python scripts/bankcard_lookup.py --key 你的AppKey 6228480402564890018
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 环境变量: export JUHE_BANKCARDCODE_KEY=your_api_key
2. 脚本同目录的 .env 文件: JUHE_BANKCARDCODE_KEY=your_api_key
3. 直接传参: python bankcard_lookup.py --key your_api_key <卡号>
免费申请 API Key: https://www.juhe.cn/docs/api/id/305
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 环境变量: export JUHE_BANKCARDCODE_KEY=your_api_key
2. 脚本同目录的 .env 文件: JUHE_BANKCARDCODE_KEY=your_api_key
3. 直接传参: python bankcard_lookup.py --key your_api_key <卡号>
免费申请 API Key: https://www.juhe.cn/docs/api/id/305
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 环境变量: export JUHE_BANKCARDCODE_KEY=your_api_key
2. 脚本同目录的 .env 文件: JUHE_BANKCARDCODE_KEY=your_api_key
3. 直接传参: python bankcard_lookup.py --key your_api_key <卡号>
免费申请 API Key: https://www.juhe.cn/docs/api/id/305
The script sends both the bank card number and API key in a URL query string to an explicit HTTP endpoint, so the request is unencrypted in transit. Query parameters are also commonly exposed in proxies, logs, browser/history equivalents, monitoring systems, and upstream infrastructure, making leakage of highly sensitive financial identifiers and credentials much more likely.
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 advertises code-capable behavior involving environment variables, file access, and outbound network requests, but it does not declare any explicit tool scope or permission boundaries. This increases the chance that an agent runtime will invoke the skill with broader capabilities than users or platform policy expect, reducing transparency and weakening least-privilege controls.
L003 的使用场景列出“查一下这个银行卡号”“这个卡是哪个银行的”“查银行卡信息”等自然语言短语,但没有限定这些短语仅在明确提供银行卡号或特定上下文时才触发。其中“这个卡是哪个银行的”这类表述在日常对话中较常见,且文档未给出不应触发的反例或边界条件。
Natural-language strings throughout the script, including the module docstring, usage instructions, and runtime messages, are fixed to Chinese. This enforces a specific language without offering the user any locale selection or documenting a justified region-specific constraint.
No suspicious patterns detected.