T09 · Insecure Skill Coding Practices
- Location
SKILL.md:38- Finding
Documentation Instructs Users to Print the API Credential File
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill performs the advertised LinkedIn employee lookup, but it also handles local API credentials, account recharge flows, diagnostic reporting, and hidden version-check persistence in ways users should review carefully.
Install only if you are comfortable giving the skill an Upkuajing API key, making paid API calls after explicit confirmation, and potentially using recharge and diagnostic-reporting flows. Do not run the documented cat command on the .env file or paste API keys into chat; prefer setting the key through a safer secret mechanism and review any error report before sending it.
SKILL.md:38Documentation Instructs Users to Print the API Credential File
scripts/auth.py:61API Key File Is Created Without Enforced Private Permissions or Symlink Protection
requirements.txt:1Third-Party Dependency Is Not Reproducibly or Integrity Pinned
The finding that the skill performs unrelated remote version checks and local metadata/cache writes suggests additional side effects beyond its stated purpose. Even if low severity by themselves, undeclared network and file side effects reduce transparency and can create policy bypass opportunities in environments expecting a simple data-query skill.
The finding that the skill performs unrelated remote version checks and local metadata/cache writes suggests additional side effects beyond its stated purpose. Even if low severity by themselves, undeclared network and file side effects reduce transparency and can create policy bypass opportunities in environments expecting a simple data-query skill.
The finding that the skill performs unrelated remote version checks and local metadata/cache writes suggests additional side effects beyond its stated purpose. Even if low severity by themselves, undeclared network and file side effects reduce transparency and can create policy bypass opportunities in environments expecting a simple data-query skill.
The finding that the skill performs unrelated remote version checks and local metadata/cache writes suggests additional side effects beyond its stated purpose. Even if low severity by themselves, undeclared network and file side effects reduce transparency and can create policy bypass opportunities in environments expecting a simple data-query skill.
The finding that the skill performs unrelated remote version checks and local metadata/cache writes suggests additional side effects beyond its stated purpose. Even if low severity by themselves, undeclared network and file side effects reduce transparency and can create policy bypass opportunities in environments expecting a simple data-query skill.
The documentation explicitly instructs reading ~/.upkuajing/.env and shows the API key format, creating a strong risk that the agent will display or otherwise exfiltrate the secret to the conversation. In skill context this is especially dangerous because the file is a local credential store unrelated to the user-visible result; exposing it compromises the third-party account and can enable unauthorized API usage and billing.
The skill directs access to a .env file that stores an API key, which is a classic credential-access pattern. In an agent setting, reading such a file can leak the secret into model context, logs, tool outputs, or user responses, enabling account compromise and unauthorized paid API consumption.
使用此技能需要API密钥。API密钥保存在 ~/.upkuajing/.env 文件中:
cat ~/.upkuajing/.env
文件内容示例:
The instructions tell the agent to inspect the local .env for the API key and potentially participate in populating it, expanding the agent's access to local credential material. This is risky because it normalizes secret-file handling inside a general-purpose skill and may lead to accidental disclosure or unsafe persistence of credentials.
### **未设置API密钥**
请先检查 `~/.upkuajing/.env` 文件是否有 UPKUAJING_API_KEY;
如果未设置 UPKUAJING_API_KEY API密钥,请提示并让用户选择:
1. 用户有,由用户提供(手动添加到 ~/.upkuajing/.env 文件)
2. 用户没有,你可使用接口进行申请(`auth.py --new_key`),申请到新密钥后,会自动保存到 ~/.upkuajing/.env
等待用户选择;
Automatically applying for a new API key and saving it to ~/.upkuajing/.env introduces credential creation and persistence side effects far beyond a read-only employee lookup workflow. If exploited or mis-executed, it can create unmanaged secrets on disk, expand account surface area, and make later leakage more likely.
请先检查 `~/.upkuajing/.env` 文件是否有 UPKUAJING_API_KEY;
如果未设置 UPKUAJING_API_KEY API密钥,请提示并让用户选择:
1. 用户有,由用户提供(手动添加到 ~/.upkuajing/.env 文件)
2. 用户没有,你可使用接口进行申请(`auth.py --new_key`),申请到新密钥后,会自动保存到 ~/.upkuajing/.env
等待用户选择;
### **账户充值**
This file implements authentication lifecycle and billing-related functions (API key issuance, account info, recharge orders, pricing) that are unrelated to the declared LinkedIn employee analysis skill. Such scope expansion is dangerous because it grants the skill extra capabilities involving credentials and payments, increasing attack surface and enabling misuse beyond user expectations.
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():
The code writes a newly issued API key in plaintext to a .env file under the user's home directory. Plaintext secret storage is dangerous because other local processes, backups, logs, or misconfigured permissions may expose the credential and allow unauthorized API use.
"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")
On write failure, the code instructs the user to manually set the API key as an environment variable, which can encourage insecure handling of secrets through shell history, process listings, or ad hoc configuration. This is weaker than secure secret management and may lead to accidental exposure.
except IOError as e:
return {
"success": False,
"message": f"API密钥申请成功,但保存到 .env 文件失败:{str(e)}。\n请手动设置环境变量 {API_KEY_ENV}。",
"envFilePath": str(env_file)
}
The ability to create recharge/payment orders has no direct relation to LinkedIn company employee discovery and introduces financial-operation capability into a data-analysis skill. If invoked unexpectedly or abused by another component, it could trigger unauthorized payment workflows or social-engineering style redirection to payment URLs.
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 manifest describes a skill for retrieving LinkedIn company page data, employee lists, and organizational insights. This file instead implements platform error reporting by collecting request metadata and sending it to '/agent/skill/error/report', which is operational telemetry rather than LinkedIn company/employee analysis behavior.
The skill declares no explicit tool scope even though its documented behavior requires environment access, local file reads/writes, and network calls. This weakens sandboxing and reviewability: a skill that can read credentials from local files and contact external services should declare those capabilities up front so operators can constrain or deny them.
The manifest description is entirely in Chinese and presents the skill as Chinese-only, with no indication that users may interact in another language or choose their preferred locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
The skill's operational scope expands from employee lookup into API key lifecycle management, recharge/order flows, and exception reporting. Bundling these functions together increases the attack surface and can pressure the agent into handling secrets, payments, and outbound reporting in contexts where the user only requested data retrieval.
Recharge order creation and returning a payment URL are materially different from querying employee data and introduce financial action risk. If misused, the skill could initiate unintended purchases or steer users to external payment flows they did not expect from a data lookup tool.
The document explicitly instructs agents to upload request parameters, response payloads, and exception context to a central error-reporting API. Even if the platform claims sensitive fields are 'automatically desensitized,' this is not a sufficient security control by itself because stack traces, raw inputs, and upstream responses commonly contain personal data, access tokens, internal identifiers, or business-sensitive content. In this skill’s context—enumerating company employees and business contacts from LinkedIn data—the likelihood of handling personal or sensitive profiling data makes such telemetry more privacy-sensitive, not less.
Detected: suspicious.exposed_secret_literal