Back to skill

Security audit

Query paginated port trade data for a company — retrieve port-level trade statistics with counts,amounts, and percentages for logistics analysis. Supports paginated port queries, companytrade port details, import-export port analysis and trade logistics drill-down acrossglobal customs data.

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised customs-port lookup, but it also handles API keys, billing/account actions, and automatic update checks in ways users should review before installing.

Install only if you are comfortable giving the skill access to an UpKuaJing API account, local ~/.upkuajing files, and billing-related account operations. Do not let an agent print the full .env file; prefer an environment variable or a securely permissioned secret file, confirm every paid query or recharge action explicitly, 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.py:73
Finding

API Key Exposure Through Terminal Output and Insecure Credential File Creation

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Third-Party Dependency Version

Content
View full analysis
=0.23.0 ``` Related installation instruction in `SKILL.md:15-18`: ```markdown 1. **Check Python**: `python --version` 2. **Install dependencies**: `pip install -r requirements.txt` ``` ### Technical Analysis The dependency declaration specifies only a minimum version. As a result, installation can resolve to any current or future `httpx` release, together with unconstrained transitive dependencies. The project contains no reviewed lock file or package hashes. This is not evidence that the current `httpx` package is malicious. The weakness is that future installations are not reproducible and may silently consume an incompatible, vulnerable, or compromised upstream release. Python package installation can execute package build logic, and imported dependencies execute code with the privileges of the user running the Skill. ### Attack Path 1. A user follows the Skill instructions and runs `pip install -r requirements.txt`. 2. The package resolver selects the latest version satisfying `httpx>=0.23.0`, along with its current transitive dependencies. 3. A future selected package version is compromised, malicious, or affected by a relevant vulnerability. 4. Malicious build-time code executes during installation, or malicious runtime code executes when the Skill imports `httpx`. 5. The dependency code operates with the same filesystem, network, environment-variable, and user privileges as the Python process. ### Impact Assessment The exact impact depends on the behavior of a compromised dependency and the privileges of the user performing installation. Potential consequences include: - Reading the `UPKUAJING_API_KEY` environment variable or credential file. - Accessing files available to the invoking user. - Send ...[truncated 390 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 (35)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checks, local version cache writes, and upgrade notifications are outside the stated purpose of querying port trade data. While often operationally useful, these hidden side behaviors create extra outbound communication and local file activity that are unnecessary for the user-visible task and could be abused or simply violate least-privilege expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Remote version checks, local version cache writes, and upgrade notifications are outside the stated purpose of querying port trade data. While often operationally useful, these hidden side behaviors create extra outbound communication and local file activity that are unnecessary for the user-visible task and could be abused or simply violate least-privilege expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checks, local version cache writes, and upgrade notifications are outside the stated purpose of querying port trade data. While often operationally useful, these hidden side behaviors create extra outbound communication and local file activity that are unnecessary for the user-visible task and could be abused or simply violate least-privilege expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Remote version checks, local version cache writes, and upgrade notifications are outside the stated purpose of querying port trade data. While often operationally useful, these hidden side behaviors create extra outbound communication and local file activity that are unnecessary for the user-visible task and could be abused or simply violate least-privilege expectations.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly instructs reading ~/.upkuajing/.env, which is a credential store containing the API key. In an agent environment, direct access to local secret files is sensitive because it exposes reusable credentials that could be leaked, reused for unauthorized API calls, or combined with broader tool access.

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

This workflow tells the agent to inspect the user's credential file and potentially initiate API key creation that is automatically written to disk. That combines secret discovery with credential lifecycle management in a skill whose main purpose is data retrieval, increasing the risk of unauthorized key handling and silent persistence of sensitive material.

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

The documented flow again directs access to ~/.upkuajing/.env and supports automatically saving a newly created key there. Repeated emphasis on local credential-file handling makes the skill more dangerous in context because the advertised business-query task does not require exposing or manipulating raw secret storage to the agent.

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

This skill is advertised as a paginated customs port trade query tool, but the file implements account provisioning, billing, recharge, and pricing functions. That hidden scope expansion is dangerous because it introduces privileged financial and credential-management capabilities unrelated to the stated purpose, increasing the chance of unauthorized API key issuance, misuse of billing features, and user deception.

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

This code writes a newly issued API key directly into a plaintext .env file under the user's home directory. Plaintext secret storage increases the risk of credential compromise through local file disclosure, backups, misconfigured permissions, malware, or accidental inclusion in support bundles and sync tools.

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

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

The file's behavior does not match the declared skill purpose: instead of querying company port trade data, it reports execution errors to a platform endpoint. This hidden or undocumented capability increases supply-chain risk because operators may deploy a skill expecting analytics while it also transmits runtime metadata off-box.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares no explicit tool restrictions even though the documented behavior requires access to environment variables, local files, and networked APIs. In an agent setting, missing scope boundaries increases the chance that the skill can read credentials, modify local state, or make outbound requests beyond what a user would reasonably expect from a simple trade-data lookup.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document explicitly instructs callers to send requestParams, responseData, and free-form context to an error-reporting endpoint. Even though it states sensitive fields are 'automatically desensitized,' there is no explicit requirement to minimize data, redact secrets before submission, or warn users that business data, identifiers, or stack traces may be transmitted to the platform. In a customs/trade analytics skill, these fields can contain commercially sensitive trade data, company identifiers, or internal error details, creating a real privacy and data-exposure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing descriptions and messages exclusively in Chinese, including the module docstring and CLI help text. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified.

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:

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Account balance lookup and pricing discovery expose account metadata and commercial information that are unrelated to port-trade analytics. In context, this creates unnecessary access to sensitive account details and signals that the skill does more than advertised, which can facilitate reconnaissance or misuse of the associated platform account.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The recharge-order creation capability lets the skill initiate billing-related actions even though the stated functionality is logistics analytics. Unrelated payment flows in a data-query skill expand the attack surface and may enable unexpected financial operations or trick users into approving charges.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code sends params to a remote API via client.post(...), and when authentication is required it also includes a bearer token in the request headers. Although the function has an internal docstring, there is no user-facing confirmation, print/log disclosure by default, or explicit warning here that user or system data may be transmitted off-host.

Content

No source excerpt is available for this finding.