T09 · Insecure Skill Coding Practices
- Location
scripts/idcard_verify.py:22- Finding
National Identity Data and API Credential Transmitted over Plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a legitimate identity-checking purpose, but it handles national ID data and an API key unsafely by using plaintext HTTP and printing full ID details.
Review this skill carefully before installing or using it. It asks for a person's legal name and national ID number and sends them to Juhe for verification; only use it with informed consent. The bundled script should be fixed to use HTTPS, avoid putting sensitive values in URLs where possible, and stop printing unmasked JSON before handling real identity data.
scripts/idcard_verify.py:22National Identity Data and API Credential Transmitted over Plaintext HTTP
scripts/idcard_verify.py:93Unmasked Identity Information Exposed Through Raw JSON Output
The documentation instructs users to write the API key into scripts/.env, which can lead to credential exposure if that file is accidentally committed, shared, or read by other local tooling. In agent-skill repositories, colocating secrets inside the project tree increases the chance of inadvertent disclosure through source control or artifact packaging.
export JUHE_IDCARD_VERIFY_KEY=你的 AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_IDCARD_VERIFY_KEY=你的 AppKey" > scripts/.env
# 方式三:每次命令行传入
python scripts/idcard_verify.py --key 你的 AppKey --name 张三 --idcard 110101199001011234
The direct API example places a real name and full ID-card number in a GET URL, which is especially risky because URLs are commonly logged by clients, proxies, servers, browser history, and monitoring tools. For identity-verification data, this creates a significant exposure path for sensitive PII even if TLS is used in transit.
The usage guidance tells the agent to collect a person's real name and ID-card number and send them for verification, but it does not explicitly warn that this highly sensitive PII is being transmitted to a third-party provider. In this context, omission of notice and consent is dangerous because users may disclose regulated identity data without understanding who receives it or how it is processed.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python idcard_verify.py --key your_api_key ...
2. 环境变量:export JUHE_IDCARD_VERIFY_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_IDCARD_VERIFY_KEY=your_api_key
免费申请 API Key: https://www.juhe.cn/docs/api/id/103
"""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python idcard_verify.py --key your_api_key ...
2. 环境变量:export JUHE_IDCARD_VERIFY_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_IDCARD_VERIFY_KEY=your_api_key
免费申请 API Key: https://www.juhe.cn/docs/api/id/103
"""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python idcard_verify.py --key your_api_key ...
2. 环境变量:export JUHE_IDCARD_VERIFY_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_IDCARD_VERIFY_KEY=your_api_key
免费申请 API Key: https://www.juhe.cn/docs/api/id/103
"""
The script sends highly sensitive PII (real name and national ID number) to a third-party API and uses an HTTP endpoint, which exposes the request URL and query parameters to interception or logging in transit. It also does not present an explicit user-facing disclosure that this data will leave the local environment and be processed by an external service, increasing privacy and compliance risk.
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 code-relevant capabilities (environment variable access, file reads, and outbound network use) but does not explicitly scope or disclose them via a permissions or allowed-tools declaration. This weakens the trust boundary for an agent runtime and can cause sensitive operations, especially third-party network transmission of identity data, to occur without clear operator awareness or policy enforcement.
All user-facing documentation, help text, errors, and output strings are hard-coded in Chinese. The file does not provide any opt-in language selection or state that the tool is intentionally limited to a Chinese-speaking or region-specific context.