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’s main paid customs-data lookup is coherent, but it also persists API credentials locally and performs under-disclosed automatic version-check network calls.

Review this before installing in environments with sensitive business data. Use a dedicated low-privilege UpKuaJing API key, avoid sharing terminal output that may include key prefixes or request details, confirm every paid query and payment action, and be aware that normal API calls also perform an automatic version check and create local files under ~/.upkuajing.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill declares no explicit permissions, yet its documented behavior includes reading environment variables, accessing local files under ~/.upkuajing, writing credentials, and making network requests. This creates a transparency and least-privilege problem: operators may approve a seemingly simple data-query skill without realizing it can handle secrets, persist data locally, and contact multiple remote endpoints.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The advertised purpose is a trade-share lookup, but the skill also performs credential provisioning, local credential storage, billing/account actions, pricing retrieval, error reporting, and version checks. That mismatch is dangerous because users may consent to a low-risk analytics tool while unintentionally authorizing sensitive account, payment, telemetry, and persistence operations beyond the stated scope.

Context-Inappropriate Capability

Medium
Confidence
85% confidence
Finding
The script sends error reports to a remote endpoint with request metadata and free-form context, yet that telemetry capability is not justified by the stated trade-analysis function. In this skill context, unexpected outbound reporting increases risk because error context may include user queries, identifiers, paths, or other sensitive operational data unrelated to the user-facing purpose.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The module performs an outbound HTTP request to a remote version-check endpoint and writes persistent cache data under the user's home directory, even though the skill's stated purpose is trade percentage analysis. This creates unnecessary data egress and side-effecting behavior beyond core functionality, which increases privacy and supply-chain risk if the endpoint is compromised or the behavior is unexpected to users.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The file adds upgrade-checking and notification behavior that is unrelated to the advertised trade-analysis capability of the skill. Hidden non-core behavior is risky because users and reviewers may not expect background networking and local state changes from a data-analysis skill, making abuse or silent telemetry easier to conceal.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documentation explicitly encourages submitting `requestParams`, `responseData`, and free-form `context` in error reports, while only asserting that sensitive fields are 'automatically masked' without defining scope, guarantees, or user/operator controls. In a trade-analysis skill, these fields can contain customer queries, company identifiers, API responses, and stack traces, so insufficient masking or overcollection could expose sensitive business or personal data to the platform during routine failure handling.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The request/response logging functions can persist full API parameters and response bodies to disk, which may include sensitive business data returned by the trade-analysis API. Although logging is disabled by default, enabling it creates silent local data retention without redaction, consent, or access-control safeguards.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The call to make_request('/agent/skill/error/report', params) uploads requestId, requestPath, context, and skill metadata without any visible disclosure, redaction, or consent mechanism. This is dangerous because exception context often contains sensitive business inputs, internal paths, or user-provided data, and sending it off-box can create privacy, compliance, and information-leakage issues.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The code sends the skill name to a remote API during version checks without any user-facing warning, consent, or visible opt-in at the call site. Even limited metadata transmission can reveal installed tools or usage patterns, and doing so silently is a privacy concern that becomes more serious in enterprise or regulated environments.

Credential Access

High
Category
Privilege Escalation
Content
### **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;
Confidence
93% confidence
Finding
The skill instructs reading and writing API credentials from ~/.upkuajing/.env and supports automatically saving newly created keys there. Accessing and persisting secrets in a local dotfile increases the risk of credential exposure through overbroad file access, accidental disclosure, insecure permissions, or reuse by other processes, especially since this behavior is embedded in a skill whose primary purpose is data querying.

Credential Access

High
Category
Privilege Escalation
Content
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**
Confidence
90% confidence
Finding
The documented flow checks for UPKUAJING_API_KEY in ~/.upkuajing/.env and, if absent, can create a new key and automatically save it locally. This combines credential discovery, creation, and persistence in one workflow, expanding the blast radius if the skill is misused or compromised and making the trade-analysis context more dangerous because secret-handling is not ancillary but operationalized.

Credential Access

High
Category
Privilege Escalation
Content
env_file = UPKUAJING_ENV_FILE

    if env_file.exists():
        # 读取现有的 .env 文件
        try:
            with open(env_file, 'r', encoding='utf-8') as f:
                content = f.read()
Confidence
83% confidence
Finding
The code reads the entire .env file and later surfaces part of the existing API key in a user-visible message. Exposing even a partial secret increases credential leakage risk through logs, terminal history, screenshots, or support captures, especially in an agent ecosystem where outputs may be persisted.

Credential Access

High
Category
Privilege Escalation
Content
"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")
Confidence
80% confidence
Finding
The API key is written in plaintext to a .env file under the user's home directory without any visible permission hardening. If the file is readable by other local users, synced, backed up, or unintentionally included in tooling, the credential can be stolen and abused to access the associated API account.

Unpinned Dependencies

Low
Category
Supply Chain
Content
httpx>=0.23.0
Confidence
90% confidence
Finding
The dependency is specified with only a lower bound (httpx>=0.23.0), which allows future major or minor versions to be installed without review. That can introduce supply-chain risk, unexpected breaking changes, or newly introduced vulnerable versions into the skill environment, reducing build reproducibility and making security validation unreliable.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/common.py:196

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:59