Back to skill

Security audit

Query trade percentage analysis — retrieve company-level trade share data for a specified HS code, ranked by trade volume. Returns a ranked list of companies with their trade counts, percentages, quantities, amounts and partner counts, with exporter/importer type and recent months filters. Helps trade analysts, sourcing agents and market researchers identify major companies trading a specific product, analyze market concentration, assess supplier competition landscape and discover potential trade partners across global customs data covering 220+ countries and territories.

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly performs the advertised paid customs-data lookup, but it handles API credentials and account/billing support in ways users should review carefully before installing.

Review this before installing if you use paid UpKuaJing API access. Do not print or paste ~/.upkuajing/.env into chat or logs, prefer setting UPKUAJING_API_KEY through a safer secret mechanism, and restrict the credential file to owner-only permissions if you use it. Be aware that the skill can create payment-order URLs, query account details, send confirmed error reports to the platform, and performs an under-disclosed version check/cache write during API calls.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.py:63
Finding

API key file is created without restrictive filesystem permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:38
Finding

Setup instructions expose the complete API credential file through terminal output

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Third-party dependency is unpinned and installed without integrity verification

Content
View full analysis
=0.23.0 ``` The documented installation command is: ```bash pip install -r requirements.txt ``` ### Technical Analysis The lower-bound-only constraint allows the package resolver to install any future `httpx` release. No upper bound, exact version, lockfile, or package hash is supplied. This does not establish that the current `httpx` package is malicious. However, it makes installations non-reproducible and permits an unreviewed future release to enter the Skill's trusted execution environment. Dependency installation and import both occur with the privileges of the user running the Skill. Because `httpx` handles bearer-authenticated network requests in this project, a compromised dependency could access request bodies, authorization headers, API responses, and local process data available to Python. ### Attack Path 1. A user follows the documented dependency-installation command. 2. The package resolver selects the newest version satisfying `httpx>=0.23.0`. 3. A future compromised, malicious, or otherwise unsafe release satisfies that range. 4. Package installation or subsequent import executes the dependency's code under the user's account. 5. Malicious code could read the API key in process memory, alter authenticated requests, inspect accessible files, or transmit data externally. ### Impact Assessment Potential impact is bounded by the privileges of the Python environment and the user performing installation. In a successful supply-chain compromise, this may include API-key theft, authenticated request manipulation, access to user-readable files, and arbitrary code execution as that user. The current audit found no evidence that the named dependency is presently malicious; the confirmed weakness is the absence of v ...[truncated 34 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (37)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checking, reading local skill metadata, writing cache files in the home directory, and emitting upgrade notices are unrelated to the skill's claimed trade-analysis purpose. These extra behaviors enlarge the attack surface through additional network calls and local file interactions that users would not reasonably expect from a simple data-query skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Remote version checking, reading local skill metadata, writing cache files in the home directory, and emitting upgrade notices are unrelated to the skill's claimed trade-analysis purpose. These extra behaviors enlarge the attack surface through additional network calls and local file interactions that users would not reasonably expect from a simple data-query skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checking, reading local skill metadata, writing cache files in the home directory, and emitting upgrade notices are unrelated to the skill's claimed trade-analysis purpose. These extra behaviors enlarge the attack surface through additional network calls and local file interactions that users would not reasonably expect from a simple data-query skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checking, reading local skill metadata, writing cache files in the home directory, and emitting upgrade notices are unrelated to the skill's claimed trade-analysis purpose. These extra behaviors enlarge the attack surface through additional network calls and local file interactions that users would not reasonably expect from a simple data-query skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The skill explicitly instructs reading the user's credential file from the home directory using commands like viewing ~/.upkuajing/.env. Direct credential-file access is sensitive because it can expose API secrets to the agent context, logs, or downstream tooling, and this is especially risky in a skill whose primary purpose is data retrieval rather than secret management.

Content

Scanner excerpt · SKILL.md (reported line 40)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
96% confidence
Finding

This section directs the workflow to check for the API key in ~/.upkuajing/.env and, if absent, to obtain and save a new key automatically. That combines secret discovery, secret provisioning, and local persistence in one flow, creating unnecessary exposure and increasing the chance credentials are mishandled or written to insecure locations.

Content

Scanner excerpt · SKILL.md (reported line 49)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
96% confidence
Finding

The continued instructions around checking and populating ~/.upkuajing/.env reinforce that the skill expects direct access to and modification of a local secret file. Repeated credential-file handling increases the likelihood of accidental disclosure, persistence in transcripts, or abuse by an over-privileged agent environment.

Content

Scanner excerpt · SKILL.md (reported line 50)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

The file implements authentication, API key provisioning, account info lookup, recharge order creation, and pricing retrieval, which materially exceeds the stated skill purpose of HS-code trade percentage analysis. This capability mismatch is dangerous because it introduces sensitive account-management operations that a user or platform reviewer would not reasonably expect from the advertised skill, increasing the risk of privilege misuse, billing abuse, and stealthy credential handling.

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/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
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 22)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
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
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

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
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

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
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

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
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The script writes a newly issued API key in plain text to a .env file under the user's home area without any visible permission hardening or secure storage mechanism. Plain-text secret storage increases the chance that other local users, backup systems, accidental commits, or unrelated tooling can read and leak the credential.

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
95% confidence
Finding

Exposing recharge-order creation and pricing functionality inside a data-analysis skill creates an unnecessary financial operations surface. If invoked unexpectedly or through misuse of the agent interface, these features could trigger billing-related actions or enable account enumeration and monetization workflows unrelated to the declared business function.

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'

# 日志开关

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a read-oriented customs trade analysis capability, but this code implements exception reporting by collecting request metadata and sending it to '/agent/skill/error/report'. Error telemetry is a different operational function than querying trade percentage analysis and is not reflected in the stated skill description.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises executable behaviors that include environment access, local file read/write, and network use, but it does not declare any explicit tool scope or permissions boundary. That makes the effective trust surface much larger than the manifest suggests and increases the chance an agent invokes sensitive capabilities without clear user awareness or policy enforcement.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description advertises trigger phrases such as "trade percentage" and especially "market share," which are broad enough to match many general business-analysis requests outside this specific customs/HS-code skill. The file does not provide exclusion conditions or tighter scoping to customs data contexts, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly instructs agents to report exception context, request parameters, and response data to a remote error-reporting API. Even though it claims sensitive fields are automatically masked, it provides no guarantee of comprehensive redaction and no requirement for user notice, consent, or data minimization, creating a real risk of leaking proprietary, personal, or credential-bearing data through telemetry.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and all user-facing CLI descriptions/messages are written exclusively in Chinese, indicating the skill is designed around a single language locale. Under the policy, language constraints should either be optional for the user or clearly documented as a justified region-specific limitation, which is not stated here.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

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
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

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
92% confidence
Finding

The module title and all user-facing strings/comments in this file are in Chinese, and there is no indication that users can choose another language or that the skill is intentionally limited to a Chinese-only audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.