Back to skill

Security audit

Query top N suppliers or buyers by trade volume — retrieve ranked lists of suppliers or buyers for a given country pair and year, with cursor-based pagination for seamless browsing. Enables comprehensive supplier and buyer ranking analysis to identify key trade partners and assess market concentration. Designed for sourcing agents, export teams and trade analysts who need to identify top trading counterparts, evaluate supplier market share and analyze buyer concentration for strategic procurement and sales planning across global customs data.

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly a disclosed paid trade-ranking API helper, but it handles credentials in ways that could expose an API key and includes extra account, payment, telemetry, and update-check behavior.

Install only if you are comfortable with this skill using an UpKuaJing API key, creating a plaintext key file under `~/.upkuajing`, making paid API calls after confirmation, and using account/top-up support flows. Do not run commands that print `.env` contents; check for key presence without exposing the key, restrict file permissions, and review any error report before sending it.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:37
Finding

API Key Exposure and Insecure Plaintext Credential Storage

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Third-Party Dependency Installation

Content
View full analysis
=0.23.0 ``` `SKILL.md:20`: ```markdown 2. **Install dependencies**: `pip install -r requirements.txt` ``` ### Technical Analysis The dependency specification sets only a minimum version. It permits pip to install any future `httpx` release and the transitive dependency versions selected at installation time. The project supplies no lock file, exact version constraints, or package hashes. The package name itself is legitimate, and the reviewed project contains no evidence that it intentionally references a malicious package. The risk arises because the installed dependency graph can change after the Skill has been audited. A compromised release, compromised package-index account, unsafe configured index, or future incompatible version could introduce unexpected code or behavior. Because the documented command installs packages from the environment’s configured indexes without hash verification, installation is not reproducible and does not verify that the resolved artifacts match an audited dependency set. ### Attack Path 1. A user follows the documented `pip install -r requirements.txt` instruction. 2. Pip resolves the newest available version satisfying `httpx>=0.23.0`, together with dynamically selected transitive dependencies. 3. A compromised or malicious permitted release is downloaded from the configured package index. 4. Package installation or subsequent import executes attacker-controlled code in the user’s Python environment. 5. That code receives the permissions of the user running pip or the Skill and can access files, environment variables, and network resources available to that account. This path requires compromise or malicious substitution of a permitted depe ...[truncated 622 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (40)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checks, local metadata parsing, and creation of cache files in the user's home directory are unrelated to the stated top-N trade query purpose. Undisclosed update-check behavior introduces additional outbound network traffic and filesystem writes, which can leak usage patterns and expand the skill's capabilities beyond what users and reviewers expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Remote version checks, local metadata parsing, and creation of cache files in the user's home directory are unrelated to the stated top-N trade query purpose. Undisclosed update-check behavior introduces additional outbound network traffic and filesystem writes, which can leak usage patterns and expand the skill's capabilities beyond what users and reviewers expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checks, local metadata parsing, and creation of cache files in the user's home directory are unrelated to the stated top-N trade query purpose. Undisclosed update-check behavior introduces additional outbound network traffic and filesystem writes, which can leak usage patterns and expand the skill's capabilities beyond what users and reviewers expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checks, local metadata parsing, and creation of cache files in the user's home directory are unrelated to the stated top-N trade query purpose. Undisclosed update-check behavior introduces additional outbound network traffic and filesystem writes, which can leak usage patterns and expand the skill's capabilities beyond what users and reviewers expect.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The skill explicitly instructs reading ~/.upkuajing/.env and even shows cat ~/.upkuajing/.env, which normalizes direct access to a credential file. In an agent context, prompting or automating reads of secret-bearing files increases the risk of accidental secret exposure to the model, logs, or downstream tooling.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

This skill requires an API key. The API key is stored in the ~/.upkuajing/.env file:

bash
cat ~/.upkuajing/.env

Example file content:

text

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The workflow directs the system to inspect a local secret file and, if needed, obtain or store an API key there. This is dangerous because it operationalizes credential handling inside a general-purpose skill, increasing the chance of exposing, overwriting, or mishandling secrets through model-driven actions.

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

md
### **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: You can apply using the interface (`auth.py --new_key`), the new key will be automatically saved to ~/.upkuajing/.env
Wait for user selection;

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

Automatically saving newly created API keys to a local .env file combines secret generation and local persistence in a way that exceeds the expectations of a ranking-query skill. If exploited or misused, this can create durable credential artifacts on disk that may later be read by other tools, leaked in backups, or exposed through logs and support actions.

Content

Scanner excerpt · SKILL.md (reported line 49)May include surrounding context.

md
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: You can apply using the interface (`auth.py --new_key`), the new key will be automatically saved to ~/.upkuajing/.env
Wait for user selection;

### **Account Top-up**

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements authentication, API key provisioning, account information retrieval, pricing lookup, and recharge order creation, which materially exceed the skill’s stated purpose of returning top-N supplier/buyer rankings. In an agent-skill context, hidden or unnecessary account-management capabilities expand the attack surface and can enable unexpected billing or credential lifecycle actions unrelated to the user’s trade-ranking task.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The code explicitly inspects a local .env file for an existing API key, which places credential material into a flat-file workflow. In this context the main risk is secret handling weakness: .env files are easily overexposed through backups, permissive file permissions, accidental inclusion in archives, or debugging output.

Content

Scanner excerpt · scripts/auth.py (reported line 18)May include surrounding context.

python
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

Reading the entire .env file to locate credentials reinforces insecure secret storage practices and increases the chance that credentials are handled more broadly than necessary. In a skill that should only perform ranking queries, this credential-centric behavior is unnecessary and raises exposure risk if the environment file is accessible to other local users or processes.

Content

Scanner excerpt · scripts/auth.py (reported line 22)May include surrounding context.

python
env_file = UPKUAJING_ENV_FILE

    if env_file.exists():
        # 读取现有的 .env 文件
        try:
            with open(env_file, 'r', encoding='utf-8') as f:
                content = f.read()

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The code writes the newly issued API key directly into a .env file, creating persistent local secret storage without any visible permission hardening or encryption. This is dangerous because API keys can be stolen from disk, copied via backups, or leaked through developer workflows, enabling unauthorized use of the associated account or API quota.

Content

Scanner excerpt · scripts/auth.py (reported line 71)May include surrounding context.

python
"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")

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code can create recharge/payment orders through '/agent/auth/pay/url', which is unrelated to supplier/buyer ranking queries and introduces a financial operation into a read-oriented skill. In a skill ecosystem, undisclosed billing functionality is dangerous because it can trigger payment workflows or socially engineer users into funding accounts they did not intend to manage.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 19)May include surrounding context.

python
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'

# 日志开关

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/auth.py (reported line 78)May include surrounding context.

python
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 63)May include surrounding context.

python
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 85)May include surrounding context.

python
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 90)May include surrounding context.

python
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a read-oriented trade ranking skill for querying ranked suppliers or buyers by country pair and year. In contrast, this code collects error-report parameters and sends them to an '/agent/skill/error/report' API, which is operational telemetry/reporting behavior unrelated to trade-volume ranking functionality.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises and instructs use of sensitive capabilities including environment-variable access, local file reads/writes, and network/API operations, but it does not declare a limiting tool scope. That creates an over-privileged execution model where a seemingly simple analytics skill can access credentials, persist data locally, and make remote requests beyond the narrow user-visible purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation explicitly allows sending raw request parameters, response data, and error context to an error-reporting endpoint. Even if the platform claims sensitive fields are auto-redacted, this still creates a data-sharing channel that can expose business data, personal data, tokens, or stack traces unless callers are clearly warned and instructed to minimize submitted content. In an agent/skill setting, error paths often contain highly contextual user inputs and backend responses, which increases the chance of over-collection during failures.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file contains the module description and CLI help/messages in Chinese only, indicating a fixed language choice. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill provisions a new API key and persists it locally, even though credential issuance is outside the declared top-N ranking use case. Unnecessary credential-management logic increases the chance of secret sprawl, accidental exposure, and misuse of newly issued credentials by components or users who only expected query functionality.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
87% confidence
Finding

Using 'require_auth=False' for '/agent/auth/create' makes the default behavior permissive around a sensitive operation: issuing credentials. In context, the mismatch between the skill’s trade-ranking purpose and its unauthenticated auth-management path makes this more dangerous, because users and reviewers may not expect secret provisioning logic in such a skill.

Content

Scanner excerpt · scripts/auth.py (reported line 41)May include surrounding context.

python
pass  # 如果读取失败,继续执行

    # 不需要认证申请新密钥
    response = make_request('/agent/auth/create', {}, require_auth=False)

    # 检查是否申请成功
    if response.get('code') != 0:

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
87% confidence
Finding

Using 'require_auth=False' for '/agent/auth/create' makes the default behavior permissive around a sensitive operation: issuing credentials. In context, the mismatch between the skill’s trade-ranking purpose and its unauthenticated auth-management path makes this more dangerous, because users and reviewers may not expect secret provisioning logic in such a skill.

Content

Scanner excerpt · scripts/auth.py (reported line 41)May include surrounding context.

python
pass  # 如果读取失败,继续执行

    # 不需要认证申请新密钥
    response = make_request('/agent/auth/create', {}, require_auth=False)

    # 检查是否申请成功
    if response.get('code') != 0:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The argparse description and argument help text are all presented in Chinese, which constrains interaction to a single language. The file does not indicate any opt-in, fallback, or justified regional limitation.

Content

No source excerpt is available for this finding.