T09 · Insecure Skill Coding Practices
- Location
scripts/person_invest.py:141- Finding
Unmasked identity data is written to standard output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent identity-lookup purpose, but it handles national ID data and API credentials in ways users should review carefully before installing.
Install only if you have a legitimate, authorized reason to run China natural-person investment or appointment lookups. Treat the queried name, national ID number, mobile number, API key, and returned records as sensitive; avoid command-line keys, avoid GET URLs with real data, and do not run it where stdout is logged unless the raw JSON output is removed or redacted.
scripts/person_invest.py:141Unmasked identity data is written to standard output
scripts/person_invest.py:251API credentials and personal identifiers are accepted through process command-line arguments
SKILL.md:72Documentation recommends placing API credentials and identity data in a GET query string
The skill recommends storing the API key in a local .env file under the scripts directory. If that directory is readable by other tools, committed accidentally, or exposed through packaging/logging, the credential can be disclosed and abused for unauthorized API usage.
# 方式一:环境变量(推荐,一次配置永久生效)
export JUHE_PERSON_INVEST_KEY=你的 AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_PERSON_INVEST_KEY=你的 AppKey" > scripts/.env
# 方式三:每次命令行传入
The example explicitly writes the secret into scripts/.env, normalizing a practice that can leak credentials through source control, backups, or accidental file reads. In a skill that already requires environment and file access, colocating secrets with executable assets increases exposure if the workspace is inspected or exfiltrated.
export JUHE_PERSON_INVEST_KEY=你的 AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_PERSON_INVEST_KEY=你的 AppKey" > scripts/.env
# 方式三:每次命令行传入
python scripts/person_invest.py --key 你的 AppKey --name 张三 --idcard 110101199001011234
The skill instructs the agent to collect and transmit highly sensitive personal identifiers, including name and national ID number, to a third-party API without an explicit privacy warning, consent checkpoint, or data-handling limitation. Because the skill is specifically designed for personal-investment and employment linkage lookups, the privacy and compliance risk is materially elevated.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python person_invest.py --key your_api_key --name 张三 --idcard 身份证号
2. 环境变量:export JUHE_PERSON_INVEST_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_PERSON_INVEST_KEY=your_api_key
申请 API Key: https://www.juhe.cn/docs/api/id/320
"""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API Key 配置(任选其一,优先级从高到低):
1. 命令行参数:python person_invest.py --key your_api_key --name 张三 --idcard 身份证号
2. 环境变量:export JUHE_PERSON_INVEST_KEY=your_api_key
3. 脚本同目录的 .env 文件:JUHE_PERSON_INVEST_KEY=your_api_key
申请 API Key: https://www.juhe.cn/docs/api/id/320
"""
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 script sends highly sensitive personal identifiers including name, ID card number, and optionally mobile number to a third-party API. Although this is the intended function of the skill, there is no explicit user-facing consent, warning, or minimization notice before external disclosure, which creates significant privacy and compliance risk if users are unaware their PII is leaving the local environment.
After formatting a partially masked summary, the script prints the full raw JSON result, which includes unmasked personal data and potentially extensive corporate relationship data. This can expose sensitive information to terminal history, logs, calling frameworks, or downstream systems that capture stdout.
The skill advertises capabilities that involve environment-variable access, file reading, and outbound network use, but it does not declare an explicit tool/permission scope. That weakens least-privilege controls and increases the chance the agent can access secrets or make network calls beyond what reviewers and runtime policy expect.
The trigger phrases are broad enough to activate on generic due-diligence or corporate-background requests, potentially causing the agent to invoke a high-sensitivity identity lookup skill when the user did not clearly request it. In context, that can lead to overcollection and transmission of personal data to a third-party API.
The natural-language docstring and command help are entirely Chinese, which effectively forces a specific language without user opt-in. The file does not state that the skill is intentionally limited to Chinese-speaking users or provide an alternate language option.
All instructions, trigger phrases, examples, and outputs are presented exclusively in Chinese, which effectively imposes a language constraint. The file does not offer user opt-in for language preference or state that the skill is intentionally limited to a Chinese-language/regional audience for compliance reasons.