T09 · Insecure Skill Coding Practices
- Location
scripts/auth.py:60- Finding
API Key Stored Without Explicitly Restrictive File Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a disclosed paid contact-validation API wrapper, with some security hygiene issues users should understand before installing.
Install only if you are comfortable sending phone numbers, emails, and domains to UpKuaJing for paid validation. Protect ~/.upkuajing/.env as a secret file, review charges before confirming paid calls or top-ups, and avoid including unnecessary personal or customer data in optional error reports.
scripts/auth.py:60API Key Stored Without Explicitly Restrictive File Permissions
requirements.txt:1Unbounded Dependency Version Prevents Reproducible Installation
scripts/version_check.py:91Automatic Version Check Discloses Skill Metadata and Writes Persistent State Without Documentation
If the skill performs remote version checks, local cache writes, and SKILL.md parsing beyond the advertised validation task, that expands its behavioral scope and creates additional network and filesystem touchpoints not clearly disclosed to users. Hidden update or telemetry mechanisms can be abused or simply violate least-surprise expectations.
If the skill performs remote version checks, local cache writes, and SKILL.md parsing beyond the advertised validation task, that expands its behavioral scope and creates additional network and filesystem touchpoints not clearly disclosed to users. Hidden update or telemetry mechanisms can be abused or simply violate least-surprise expectations.
If the skill performs remote version checks, local cache writes, and SKILL.md parsing beyond the advertised validation task, that expands its behavioral scope and creates additional network and filesystem touchpoints not clearly disclosed to users. Hidden update or telemetry mechanisms can be abused or simply violate least-surprise expectations.
If the skill performs remote version checks, local cache writes, and SKILL.md parsing beyond the advertised validation task, that expands its behavioral scope and creates additional network and filesystem touchpoints not clearly disclosed to users. Hidden update or telemetry mechanisms can be abused or simply violate least-surprise expectations.
If the skill performs remote version checks, local cache writes, and SKILL.md parsing beyond the advertised validation task, that expands its behavioral scope and creates additional network and filesystem touchpoints not clearly disclosed to users. Hidden update or telemetry mechanisms can be abused or simply violate least-surprise expectations.
The skill instructs checking and manually populating ~/.upkuajing/.env with an API key, which involves local credential discovery and storage. Any skill that reads or writes credential files increases the risk of secret exposure, accidental overwrite, insecure file permissions, or exfiltration if paired with network capabilities.
### **API Key Not Set**
First check if the `~/.upkuajing/.env` file has UPKUAJING_API_KEY;
If UPKUAJING_API_KEY is not set, prompt the user to choose:
1. User has one: User provides it (manually add to ~/.upkuajing/.env file)
2. User doesn't have one: Guide user to apply at [UpKuaJing Open Platform](https://developer.upkuajing.com/)
Wait for user selection;
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
申请新的 API 密钥。
"""
# 检查是否已存在 .env 文件和 API key
env_file = UPKUAJING_ENV_FILE
if env_file.exists():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
申请新的 API 密钥。
"""
# 检查是否已存在 .env 文件和 API key
env_file = UPKUAJING_ENV_FILE
if env_file.exists():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
申请新的 API 密钥。
"""
# 检查是否已存在 .env 文件和 API key
env_file = UPKUAJING_ENV_FILE
if env_file.exists():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
申请新的 API 密钥。
"""
# 检查是否已存在 .env 文件和 API key
env_file = UPKUAJING_ENV_FILE
if env_file.exists():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
申请新的 API 密钥。
"""
# 检查是否已存在 .env 文件和 API key
env_file = UPKUAJING_ENV_FILE
if env_file.exists():
Writing a newly issued API key into a plaintext .env file under the user's home directory creates a local secret-storage weakness. If filesystem permissions are too broad, backups are exposed, or other local processes can read the file, the key can be stolen and abused to access the associated account or API usage.
"envFilePath": str(env_file)
}
# 保存到 .env 文件
try:
with open(env_file, 'w', encoding='utf-8') as f:
f.write(f"{API_KEY_ENV}={api_key}\n")
The failure path instructs the user to manually set the API key as an environment variable, which is not inherently unsafe, but together with plaintext-file storage reflects weak secret-handling practices and increases the chance of exposure through shell history, process listings, or misconfigured environments. This is a security hygiene issue rather than direct credential exfiltration.
except IOError as e:
return {
"success": False,
"message": f"API密钥申请成功,但保存到 .env 文件失败:{str(e)}。\n请手动设置环境变量 {API_KEY_ENV}。",
"envFilePath": str(env_file)
}
Creating recharge orders is a payment-related capability unrelated to validating contact information, and exposing it through this skill can trigger financial workflows users do not expect. In a skill advertised for data cleansing, hidden or loosely justified payment actions are especially risky because they can be abused to initiate unauthorized billing steps or social-engineer users into completing payments.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API_BASE_URL = "https://openapi.upkuajing.com"
API_KEY_ENV = "UPKUAJING_API_KEY"
UPKUAJING_DIR = Path.home() / '.upkuajing'
UPKUAJING_ENV_FILE = UPKUAJING_DIR / '.env'
UPKUAJING_LOGS_DIR = UPKUAJING_DIR / 'logs'
# 日志开关
The skill declares no explicit tool scope even though its documented behavior requires environment access, filesystem reads/writes, and network/API calls. That creates an overbroad, under-specified trust boundary: users and hosting platforms cannot easily constrain what the skill may access, increasing the chance of unintended credential, file, or network exposure.
The description embeds activation phrases such as "email validation," "domain verification," and especially "CRM data cleansing," which are broad capability descriptions rather than narrowly scoped invocation triggers. The file does not provide exclusion conditions or negative examples, so these phrases could cause unintended invocation for ordinary requests about general data cleanup or verification.
Including top-up order creation and payment guidance inside a contact-validation skill introduces billing functionality outside the core purpose. This increases phishing-like risk and the chance that users are steered into financial actions from a workflow they expected to be purely technical validation.
This markdown file presents all user-facing documentation exclusively in Chinese, and it does not indicate that the skill is region-specific or provide any opt-in or alternative language. Under the policy, forcing a specific language without user choice or justification is a natural-language policy violation.
The document instructs agents to report exceptions by sending request parameters, response data, and error context to a remote API. Even though it mentions automatic masking of sensitive fields, it does not define what is masked, does not require minimization, and does not warn operators that contact data, tokens, stack traces, or user-provided content could be transmitted off-path during failures. In a contact-validation skill, failed requests may contain emails, phone numbers, WhatsApp-related data, and CRM records, making unintended disclosure more likely.
This file implements account provisioning, account information lookup, recharge-order creation, and pricing queries, which materially exceed the declared contact-validation behavior of the skill. Such scope expansion increases the attack surface and can enable unintended account or billing interactions through a skill that users would not reasonably expect to manage platform authentication and payments.
The module title, descriptions, and all user-facing CLI help/messages are written only in Chinese, which imposes a specific language on users. The file does not offer a language choice or explain that the skill is intended only for a Chinese-speaking or region-specific audience.
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
pass # 如果读取失败,继续执行
# 不需要认证申请新密钥
response = make_request('/agent/auth/create', {}, require_auth=False)
# 检查是否申请成功
if response.get('code') != 0:
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
pass # 如果读取失败,继续执行
# 不需要认证申请新密钥
response = make_request('/agent/auth/create', {}, require_auth=False)
# 检查是否申请成功
if response.get('code') != 0:
Account balance and pricing retrieval expose business-account information beyond the core validation use case and can leak operational or financial metadata. While not as severe as direct payment initiation, these capabilities expand access to sensitive account details and normalize account-management behavior in a skill whose stated purpose is contact verification.