Back to skill

Security audit

Query paginated national trade list data — retrieve country-level trade breakdowns with annual, quarterly, and monthly trade volumes for comprehensive market analysis. Enables multi-dimensional country comparison with detailed trade volume decomposition across time periods. Designed for export teams, market researchers and trade analysts who need to compare import-export volumes across countries, analyze market penetration and identify growth opportunities through structured country trade data across 220+ countries and territories.

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly performs the advertised trade-data queries, but it needs review because it handles paid-account API keys, top-up/order flows, plaintext local credentials, and automatic version-check traffic.

Install only if you trust UpKuaJing with paid API access. Do not print the `.env` file or paste the API key into chat; prefer a secret manager or tightly permissioned environment variable, confirm every paid query or top-up action, and review any error report payload 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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:37
Finding

API Key Disclosure Through Documented Credential Inspection

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.py:61
Finding

API Key File Is Written Without Explicit Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Dependency Version Allows Unreviewed Future Releases

Content
View full analysis
=0.23.0 ``` The installation instructions execute: ```bash pip install -r requirements.txt ``` ### Technical Analysis The dependency declaration specifies only a minimum version and has no upper bound, exact pin, lock file, or integrity hash. A new installation may therefore select a future `httpx` release that was not tested or reviewed with this Skill. This creates non-reproducible builds and exposes installations to upstream compromise, unexpected transitive dependencies, or incompatible behavioral changes. The audit found no evidence that the current `httpx` package is malicious; the issue is the unrestricted dependency-resolution policy. ### Attack Path 1. A user installs the Skill dependencies using the documented `pip install` command. 2. The package resolver selects the latest release satisfying `httpx>=0.23.0`. 3. A future compromised, vulnerable, or incompatible release is downloaded from the configured package index. 4. Package installation or later import executes or exposes behavior that was not part of the audited Skill version. 5. The unreviewed dependency operates in the same process context as the Skill, including during authenticated network requests. ### Impact Assessment A compromised dependency could execute with the privileges of the user running the Skill and could potentially access environment variables, the local API-key file, network traffic prepared by the application, and files accessible to that user. Under ordinary circumstances, the more likely impact is build instability or runtime incompatibility rather than exploitation. ]]>
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 (39)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform version checks, read local metadata, and maintain a cache file unrelated to the advertised trade-query task. These side behaviors expand the attack surface and can create unexpected network and filesystem activity under the guise of a simple data lookup tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill appears to perform version checks, read local metadata, and maintain a cache file unrelated to the advertised trade-query task. These side behaviors expand the attack surface and can create unexpected network and filesystem activity under the guise of a simple data lookup tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform version checks, read local metadata, and maintain a cache file unrelated to the advertised trade-query task. These side behaviors expand the attack surface and can create unexpected network and filesystem activity under the guise of a simple data lookup tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform version checks, read local metadata, and maintain a cache file unrelated to the advertised trade-query task. These side behaviors expand the attack surface and can create unexpected network and filesystem activity under the guise of a simple data lookup tool.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The skill instructs reading the full ~/.upkuajing/.env file with cat, which exposes secrets beyond the single API key and normalizes direct credential inspection. In an agent setting, this is especially risky because it encourages plaintext secret handling and could leak credentials into logs, transcripts, or downstream tools.

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

The skill directs the agent to inspect a local secret file and, if absent, initiate API key creation and automatic saving into that file. This combines credential discovery, generation, and persistence in one workflow, creating opportunities for unauthorized secret handling and long-lived plaintext storage.

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

The workflow tells the agent to check whether UPKUAJING_API_KEY exists in ~/.upkuajing/.env and potentially write user-provided or newly created credentials there. In this context, the danger is elevated because the skill is ostensibly a data-query tool, yet it manipulates local credential storage and could expose or overwrite secrets without strong isolation.

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 adds broad account-management capabilities—API key provisioning, account balance lookup, recharge order creation, and pricing queries—that are unrelated to the declared purpose of a read-only trade-list querying skill. In an agent-skill context, unnecessary financial and credential-management functionality expands the attack surface and could let the skill trigger account or billing side effects beyond what users expect.

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

Writing a newly issued API key directly into a plaintext .env file under the user's home directory creates a secret-at-rest exposure. Other local processes, backups, logs, or misconfigured file permissions could disclose the credential, enabling unauthorized API use and potential account abuse.

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

The skill can create recharge/payment orders despite being described as a data-query tool. Billing-related actions are high risk because they introduce financial side effects that could be invoked unexpectedly by an agent or a user who only intended to fetch trade data.

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

This file implements telemetry for reporting runtime errors to a remote platform rather than functionality for querying paginated country trade-list data promised by the skill manifest. That mismatch is security-relevant because hidden or undisclosed auxiliary network behavior expands the skill’s privileges and can enable covert data collection or unexpected outbound communication during agent execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The primary behavior in this code path is skill version management, including remote POST requests and user-environment file writes, rather than the declared trade-data functionality. In a skill ecosystem, undeclared non-functional behavior is dangerous because it can bypass user expectations, complicate review, and enable covert telemetry or control channels through an attacker-controlled api_base_url.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill declares executable capabilities involving environment access, file reads/writes, and network use, but does not constrain them with an explicit tool scope. That creates unnecessary ambient authority: an agent invoking this skill may access credentials, local files, or remote endpoints beyond what a simple trade-list query should require.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description lists triggers such as "country trade list" and "national trade breakdown" without specifying invocation constraints or exclusion conditions. These phrases are generic enough to match ordinary analytical requests, increasing the chance of unintended activation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document explicitly instructs agents to send request parameters, response payloads, and exception context to an external error-reporting API. Even though it says sensitive fields are automatically masked, it does not require minimization, user notice, or strict exclusion of secrets/PII, so operational data, prompts, identifiers, or business-sensitive trade queries could still be transmitted unnecessarily.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code provisions a new API credential and persists it locally, which is broader than the stated purpose of querying trade data. Automatic credential issuance and storage can create unmanaged secrets, confuse trust boundaries, and enable later misuse of the account or API from the local environment.

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: